How to remove extra space in argument to shell script
I have a shell script which accepts 4 arguments
to execute the script
my.sh a b c d
In the script I set
When it works, I'll have F1=a, F2=b, F3=c and F4=d
I did not create the caller program. But when they make the call with an extra space between the arguments, it kills my script
for example, when they issue
my.sh a b c d (an extra space between a and b
I think my script will get F1=a F2= F3=b F4=c and it will fail because the F values are wrong.
What is the best way to check and fix the problem (i.e to protect myself from being killed). I can't do nothing about the caller mistakes.