Hi,

According to man bash, I thought that $@ instead of $* can help me
pass a string with space as a parameter. But it is not. Would you
please show me how to print 'b c' as a single argument in the
following code?
#!/usr/bin/env bash

function f {
#for i in $*;
for i in $@;
do
  echo $i
done
}

f a 'b c' d e f g


$ ./main.sh
a
b
c
d
e
f
g

-- 
Regards,
Peng

Reply via email to