bug-bash
[Top][All Lists]
Advanced

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

Quotes inserted into command


From: Matt Kane
Subject: Quotes inserted into command
Date: Tue, 22 May 2007 16:27:30 -0400
User-agent: Microsoft-Entourage/11.3.3.061214

Hello,

I've got a script that does the following:
JAVA=/usr/bin/java
JAVA_W_CLASSPATH="$JAVA -cp \"$classpath\" "
$JAVA_W_CLASSPATH com.choicestream.foo
echo $JAVA_W_CLASSPATH

I've noticed that on different versions of bash, it behaves differently.
Bash 3.0 will execute:
/usr/bin/java -cp "/path/to/classes" com.choicestream.foo
And display the same.

But Bash 3.1 and 3.2 put single quotes around the double quotes when
executing.
/usr/bin/java -cp '"/path/to/classes"' com.choicestream.foo
But it will display:
/usr/bin/java -cp "/path/to/classes" com.choicestream.foo

I don't understand the reason for the discrepancy, and searching for "bash
quotes" gives me a lot of bash.org nonsense.

Thanks!

-- 
Matt Kane : address@hidden
AIM: mkbatwerk



reply via email to

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