#!/bin/bash
for arg
do
echo "$arg"
done
In file called compile.
I tried this:
compile ha -aa -bb -cc -dd -ee -ff -gg
ha
-aa
-bb
-cc
-dd
-ff
-gg
Why does -ee not show up?
In fact, it seems that -[e]+ does not show up.
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.
Because the version of
echoyou use takes-eas an option (meaning “expand escape characters”).Edited to add:
The standard response to this type of question is “use printf”, which is strictly accurate but somewhat unsatisfactory.
printfis a lot more annoying to use because of the way it handles multiple arguments. Thus:Of course, you just need to remember to quote the entire argument sequence, but that can lead to annoying quote-escaping issues.
Consequently, I offer for your echoing pleasure: