It is currently Mon, 25 Sep 2023 11:20:57 GMT



 
Author Message
 space in command line args
I know this must be in the FAQ but still not able to find it , pls
excuse me

How to accept space in command line args

I have a simple script like this
#!/bin/bash
for i in $*;do
    echo "ARG = $i"
done
exit 0

So  if i run
export IFS=`echo -e "\n"`
./myscript.sh "hello ram"

I would expect
ARG = hello ram

BUT I get
ARG = hello
ARG = ram

BTW If I put export IFS line in the script it does work
I dont understand why

Thanks
Ram



 Sun, 16 Oct 2005 15:44:05 GMT   
 space in command line args

for i in "$@"; do

--
Alexis
http://dione.no-ip.org/~alexis/



 Sun, 16 Oct 2005 21:21:21 GMT   
 
   [ 2 post ] 

Similar Threads

1. CGI commands with command line args?

2. how to set argv command line args for ps

3. How to find out all the input args of a long command line

4. Script/Command line args for FTP needed!!

5. How to hide command line args under Solaris

6. Command-line args in C

7. Command line args

8. command line args and 'if'

9. csh script command line args

10. command line args in csh scripts (-f and -d)


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software