I have a library file in which I have one alias:
$ cat mylib.sh
alias mal='ls -l'
$cat test.sh
#!/bin/bash
source mylib.sh
mal
$./test.sh
./test.sh: line 3: mal: command not found
Any thoughts?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To execute an alias in a non-interactive shell, use
You might instead want to use functions: