Closed dpinol closed 6 years ago
Glad you find #21 :) I was about the comment that. Let me know if you run into any other issues.
@edc Hi, why was #52 closed? I understand it describes a common limitation and #21 is also closed
thanks!
Sorry for the late response. Your trouble was due to bash not expanding aliases in script mode. You just need to add shopt -s expand_aliases
to the beginning of your bash script.
For example:
$ cat kk.sh
shopt -s expand_aliases
set -x
alias gcb="python -V"
alias
gcb
Now this is a valid bash script. If you wish to execute the script, you don't need bass. You just need to bash it:
$ bash kk.sh
+ alias 'gcb=python -V'
+ alias
alias gcb='python -V'
+ python -V
Python 2.7.10
If what you want is to "inherit" the aliases and other environment variables in the script, then you have to source it, just like if your shell is bash:
$ bass source kk.sh
...
$ gcb
Python 2.7.10
Hi, does bass support converting bash alias?
~> bass alias gcb="git pull" bash: line 0: alias: pull: not found exit code: 1 Bass encountered an error!
If I bass the following file...
~> cat kk.sh set -x alias gcb="git pull" alias gcb
...I get:I saw https://github.com/edc/bass/issues/21, but the problem is that
alias "xx='echo lol'"
is not valid in bashIt should be :
thanks