For example if I have a setup like:
alias llaa = pwd && ll'''
Will the second command work, or would I have to set it up in a more verbose manner (like ```alias llaa = pwd && ls -la```)
For example if I have a setup like:
alias llaa = pwd && ll'''
Will the second command work, or would I have to set it up in a more verbose manner (like ```alias llaa = pwd && ls -la```)
7 Comments
sin_free_for_00_days@sopuli.xyz · 9 pts · 1y
Should work. Just try it out and see if you get what you want. I tried:
then ran
llaaand it did what I expected, current directory and the output ofls -alwhich is aliased.7uWqKj@lemmy.world · 7 pts · 1y
Yes. How about just trying it out?
solrize@lemmy.world · 7 pts · 1y
I think you don't want the spaces around the= sign. Preferred over alias is function llaa { ... }. Alias is for backwards compatibility.
Successful_Try543@feddit.org · 1 pts · 1y
Again what learned. What is wrong with having spaces around the equals sign, though?
solrize@lemmy.world · 2 pts · 1y
I think it might not work with the spaces. But if it does, then you are fine.
Successful_Try543@feddit.org · 4 pts · 1y
Ah, obviously you're right and bash is less tolerant to spaces than I've had in my mind:
https://www.digitalocean.com/community/tutorials/an-introduction-to-useful-bash-aliases-and-functions
some_guy@lemmy.sdf.org · 7 pts · 1y
You wanna use double quotes to wrap it:
alias llaa="pwd && ll'''"