12
votes
2answers
337 views

Should I use $* or $@?

Which one of $* or $@ is better to use (in array syntax,command line parameters, etc.) to avoid any bugs/problems in code? Or it does not make any difference?
2
votes
2answers
85 views

Parameter expansion seems to be missing a piece

I'm currently learning how to write simple scripts and can't get my head around a very simple problem. I have the following command in my script... touch ${DIRECTORY}/${FILE} This command appears ...
2
votes
2answers
123 views

Parameter splitting

I have a bash script that is a simple wrapper around another process: $ cat ~/bin/s3cmd #!/bin/sh trickle -u 80 ~/bin/s3cmd.py $* $ This works great when the parameters don't contain spaces. ...
3
votes
2answers
1k views

How to escape < or > in a parameter in shell?

I'd like to use grep with a PCRE expression that contains the < character. Bash thinks I want to redirect, but I don't want to. How can I escape <?