LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

Make a bash script recognize bash aliases

Posted 05-12-2015 at 04:16 PM by the dsc (linux-related notes)
Updated 05-12-2015 at 04:22 PM by the dsc (mismatched tags)

Say, if you have a script that would take as a parameter something that you have aliased, it wouldn't work.

I mean:

$ ./script.sh myalias whatever else
/home/dude/scripts/script.sh: line 3: myalias: command not found



In order to make it work, the said script must include:

Code:
shopt -s expand_aliases
source ~/.bash_aliases
(Or wherever your aliases are set, which would preferably be...
Member
Posted in Uncategorized
Views 1442 Comments 0 the dsc is offline

  



All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration