Answer the question
In order to leave comments, you need to log in
Working with alias via script
Never faced such a problem before. I just write alias in the console and get information about alias(s). If I run it through a script (i.e. I just write alias in a text document and run it for execution), it doesn't show anything. There are no problems with other commands, but alias does not want to work through the script in any way. Tell me how to be ... (It is necessary to check in the script whether there is an alias for one command. If there is, cancel it, and apply it back at the end of the script. I already wrote everything. But it turned out that he didn’t want to work out the alias in any way .... ) What are the features?
Answer the question
In order to leave comments, you need to log in
In bash, you can
run it through bash -i and write shopt -s expand_aliases . Then you don't have to do it . $HOME/.bashrc .
That is, in the script it will look like this:
#!/bin/bash -i
shopt -s expand_aliases
alias
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question