Link to home
Start Free TrialLog in
Avatar of AmitBAcharya
AmitBAcharyaFlag for India

asked on

Can we use alias in a perl script

Hi
I have an alias 'push_hermes' defined under /home/www/.bashrc -
alias push_hermes='cd ~/supervision/hermesAdmin; perl  runLandSiteAdminWithAction.pl $*'

While I am trying to use this alias in a perl script -
system ("push_hermes $site_name $project_name push"), the system() command doesn't seem to recognise the push_hermes alias.

As a work around, I discontinued the use of the alias and made it inline in the perl script and it is working now. But I wanted it know, if it is possible to use an alias in the perl script?

Regards
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AmitBAcharya

ASKER

How do I change my system command in the perl script to take up the bash alias?
Can you provide a syntax of it?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the info guys!