Skip to content

Tag: quoting

Bash script: too many arguments in [ test ]

I have the bash script below: When I run it: As you can see, when I don’t pass parameters ( $# -eq 0 ) it fails with “too many arguments”. So, I tested it directly in terminal: So, if it works perfectly in terminal why doesn’t it work passing parameters? Thanks, Answer Your entire expr…