bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to pass arguments with space inside?


From: lehe
Subject: how to pass arguments with space inside?
Date: Thu, 9 Apr 2009 13:46:27 -0700 (PDT)

Hi,
I was wondering how to pass arguments with space inside. For example, my
bash script looks like:

#!/bin/bash
ARG_OPTS=""
while [[ -n "$1" ]]; 
        ARG_OPTS="${ARG_OPTS} $1"
        shift 
done

If I pass an argument like "--options='-t 0 -v 0'", then it would be
splitted by the spaces inside, ie "--options='-t", "0", "-v" and "0".

How can I achieve what I wish?

Thanks and regards!
-- 
View this message in context: 
http://www.nabble.com/how-to-pass-arguments-with-space-inside--tp22978918p22978918.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]