Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute bash alias

Status
Not open for further replies.

MigrantFirmWorker

Programmer
Apr 9, 2003
54
US
I have a utility that I would like to run from a Perl script. The utility is run via an IT maintained alias.

I can run the command directly but the path can change without warning (while the alias is constant). Unfortunately, "command" and "open" do not recognize the alias.

Any suggestions? Thanx.

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
Hi

You forgot to mention how that alias is defined and how you are trying to execute it.

If it is defined in /etc/bash.bashrc or ~/bashrc or a file sourced into those two, then execute the alias in another Bash instance, explicitly set interactive :
Perl:
system 'bash -i -c "youralias par ame ter"';

Feherke.
 
Works like a charm. Thank you very much!

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top