in reply to system calls and shell aliases

Whaow, Thank you guys for the quick response. The tt was only an dirty instance I used for exemplification. In reality, I am supposed to write a script to run as a cron for an integrated library system. This system runs a number of interactive aliases. I was hoping to use the shortcut of just running the aliases. The ideas of creating executable shell scripts sounds like an excellent idea. Thank you so much guys. Randal, it's an honor! Alia(s)mused..

Replies are listed 'Best First'.
Re^2: system calls and shell aliases
by Anonymous Monk on Jun 14, 2015 at 10:11 UTC
    why not sourcing your .bashrc (or anywhere you define your alias) before calling the alias?
    perl -e 'system("source ~/.profile; source ~/.bashrc; bash --login -c +l");'
    For instance, matlab is an alias for me defined in ~/.profile. Try to check if matlab exist as a command from perl:
    $perl -e 'system("command -v matlab")' $perl -e 'system("source ~/.profile;command -v matlab")' alias matlab='/Applications/MATLAB_R2015a.app/bin/matlab'
    Best, Hatef