You are not logged in.
Pages: 1
I have two lines in ~/.bashrc that read
alias sudo='sudo -v; sudo '
alias update='sudo pacman -Syu'I also have those lines in /etc/bash.bashrc.
Yet for some reason, typing "update" in the terminal yields
$ update
update may be found in the following packages:
community/gitlab 13.9.4-1 /usr/share/webapps/gitlab/bin/update
community/gitlab 13.9.4-1 /usr/share/webapps/gitlab/vendor/bundle/ruby/2.7.0/gems/bootstrap_form-4.2.0/demo/bin/update
community/mailman 2.1.34-2 /usr/lib/mailman/bin/updateI can set the alias for the specific terminal session as such:
$ alias update='sudo pacman -Syu'
$ update
:: Synchronizing package databases...etc.
Of course, if I do this then it won't save the alias for any other terminal session. I have tried rebooting and the .bashrc aliases are still not working, and I made sure they're not commented. I can't find anything from the Bash or Sudo pages on the Archwiki that give any further instruction on this, so I really don't understand what's going on here. I'm undoubtedly missing something, I'm just too much of a noob to figure it out on my own.
Last edited by MegaMexican (2021-10-09 04:37:25)
Offline
What does
$alias updatein a terminal return?
Offline
And
echo $0"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
$ alias update
alias: Body cannot be empty
$ echo $0
$ echo $0 produces a blank line.
Last edited by MegaMexican (2021-10-08 23:48:05)
Offline
Ah, ok, usually it'd give the name of the shell. Are you sure you are running bash (not zsh, or some other shell)? The following may also confirm:
cat /proc/$$/cmdline
echo $SHELLCan you define other things in your bashrc that are picked up in your interactive shell?
EDIT: these do not look like bash error messages.
EDIT 2: these are 'fish' error messages. If you are running the fish shell, obviously bashrc will not be read! Follow the wiki for your shell.
Last edited by Trilby (2021-10-09 01:13:52)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yep, you are spot on! I completely forgot that I technically am not using bash. It's easy to forget since fish uses all the same commands for the most part. Here's how to do it for fish:
$ alias update='sudo pacman -Syu'
$ funcsave updateAnd now it works across any terminal session.
I knew I was missing something! Thanks for helping me figure it out, now my noobery has gone down a little bit I hope. And thanks for being patient with my suboptimal responses, I'll try to be more detailed in the future.
Last edited by MegaMexican (2021-10-09 04:34:30)
Offline
Pages: 1