I have an alias called
save_aliasesthat doesalias > ~/.bash_aliases.aliason its own just dumps all the existing aliases to the terminal in a format that can be parsed by Bash.I felt especially clever when I came up with that and used it to save itself.
Bonus fact:
${BASH_ALIASES["name-here"]}is a way to get at the contents of an alias without resortingsedorcutshenanigans on the output of thealiascommand.zshrc, bashrc, tomato, tomato, potato, potato
same shit, just replace zsh with bash. the syntaxes for the two aren’t QUITE the same but they’re so fuckin close they might as well be one language
Just different enough to break your rc files when you try to migrate :)
basically, yeah. y’all aren’t gonna believe this but i just found out the other day that you don’t need the
cdwith zsh. you can just type in the directory name. i don’t even know what else is different, i learned how to use the terminal from watching youtube linux tutorials so i might be just a lost bashbroI wouldn’t be surprised if all shells have some form of that, but not enabled by default. I know Bash does, but I’ve never turned it on.
i took the oregon trail
My version is definitely wordier, but I like it.
add-alias() { if [[ -z "$1" || -z "$2" ]]; then echo "Useage: add-alias <alias_name> \"<command_to_alias>\"" return 1 fi echo "alias $1='$2'" >> ~/.bash_aliases source ~/.bash_aliases echo "Alias '$1' for command '$2' added and sourced." }And, of course, the first thing I test it with is
$ add-alias alias-add add-alias.what i do is type out the alias and then hit enter, and then up arrow, quote, ctrl+a, add quote
I’d call it
rcappndinstead of add thoi like my variable names and aliases to sound like natural english, which means you have to conjugate the functions differently. they’re supposed to be third person singular
sorry guys i’m not a computer nerd but i’m a linguist so i like languages, including the computer ones
Have you heard of our lord and savior perl?
As a fish user i relate to this





