LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


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 12:24 AM.

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