The -V option with qusb only importing the environment variable but not the alias from .bashrc . For example
### in .bashrc
alias ll='ls -ltr'
alias la='ls -A'
and the qsub script is
In this case
echo $PYTHONPATH and
ls works fine but
la gives error
ll: command not found .
So how to import the alias commands in qsub ?
OR is there any better alternative to
alias so that commands (
la) behave like
ls and can be easily imported
Aliases are intended to be command-line conveniences. They are not well-suited for use in scripting. For most purposes, you should use functions. Functions can be exported to child Bash scripts, but not likely to other environments.
That said, you can try explicitly sourcing your
~/.bashrc in your qsub script.
I don't know which of these is supported by qsub.
~/.bashrc is not interpreted if you run a script not in an interactive mode.
You must switch the interactive mode on
or better just import
~/.bashrc explicitly at the beginning of the script: