Why aliases in a non-interactive Bash shell do not work
The command shopt -s expand_aliases will allow alias expansion in non-interactive shells.
The command shopt -s expand_aliases will allow alias expansion in non-interactive shells.
After some thinking and research, the answer turned out to be trivial: git rebase -i takes the editor name from the well-known EDITOR/VISUAL environment variables, so overriding that to point to a non-interactive script does the job. However, EDITOR/VISUAL applies indifferently to the list of commits, commit messages when rewording and anything else. So, since … Read more
Many ways pipe your input echo “yes no maybe” | your_program redirect from a file your_program < answers.txt use a here document (this can be very readable) your_program << ANSWERS yes no maybe ANSWERS use a here string your_program <<< $’yes\nno\nmaybe\n’