How to send as many inputs as we have to the program using bash script? -


running arithmetic parser using bash script inside bash reading inputs using : $@ because every time can have different number of inputs. when send 1+1 can parse fine when send (1+1) error:

 -bash: syntax error near unexpected token `1+1' 

how can change able read parenthesis well?

note: parser works fine parenthesis.

quote arguments when calling bash script:

bash myscript.sh "(1+1)" 

or escape special characters:

bash myscript.sh \(1+1\) 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -