introduction-to-bash-scripting icon indicating copy to clipboard operation
introduction-to-bash-scripting copied to clipboard

Feature: avoid this in Alias

Open c4ir0 opened this issue 3 years ago • 1 comments

I faced a problem while making aliases i hope this note would help

(Note : deal with ~/.bashrc or ~/.zshrc according to the shell u use )

make sure first what shell do use the command below will let u know :

echo "$SHELL"

why do you have to know ..? because editing the ~/.bashrc while u use zsh and even resourcing or logging out will give no benefit since u configure a file for shell ur not currently using commands : if u use zsh ~> nano /.zshrc if u use bash ~> nano /.bashrc and so on ..

c4ir0 avatar Sep 10 '22 10:09 c4ir0

Great suggestion! I’ll have to submit a PR to add this information! Thanks for bringing this up!

bobbyiliev avatar Sep 11 '22 02:09 bobbyiliev

I'd like to provide a counter argument.

The chapter to which you are referencing is called Creating custom bash commands. The title tells me that I need to personally convert concepts to my environment, if I choose to use something different than bash itself.

There is no end to this if you cater to an alternate shell. You can't possibly cover every solution, both present and future.

FearTheBadger avatar Sep 30 '22 19:09 FearTheBadger

This is a valid point @FearTheBadger! Maybe just a warning mentioning that if the user uses a different shell then they need to update the corresponding file rather than trying to list all possible ones.

bobbyiliev avatar Oct 04 '22 10:10 bobbyiliev

I'd like to provide a counter argument.

The chapter to which you are referencing is called Creating custom bash commands. The title tells me that I need to personally convert concepts to my environment, if I choose to use something different than bash itself.

There is no end to this if you cater to an alternate shell. You can't possibly cover every solution, both present and future.

it really worth to check that I wrote I faced a problem while making aliases i hope this note would help in bold meaning as a beginner you might ( or will ) face such a problem especially while using OS deploys other shells (not bash) by default , so take care ... but not meant to use alternative ways to do the same job in bash with other shells !!

c4ir0 avatar Oct 04 '22 12:10 c4ir0