I'm making a bash script to do basic arthmetic and when I do:
if [ $2 == "*" ]
it does not work.
How can I check for asterisk?
|
I'm making a bash script to do basic arthmetic and when I do:
it does not work. How can I check for asterisk?
| ||||
|
feedback
|
|
You need to escape or quote the asterisk in the command line:
and enclose the
| |||||
feedback
|
|
The problem isn't that the So if your script was called
The To avoid expansion, you would need to do
The You might want to consider | |||
|
feedback
|
bcordcif you want a calculator. – JdeBP Nov 25 '11 at 9:56