|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
ksh quote or no quote whitespace madness
The program:
Code:
#!/bin/sh THIS=' aa bb cc dd ee ff' THAT=" zz yy xx ww " echo \"THIS: [\${THIS}]\" echo ------------------- echo "THIS: [${THIS}]" echo echo THIS: [\${THIS}] echo ------------------- echo THIS: [${THIS}] echo echo \"THAT: [\${THAT}]\" echo ------------------- echo "THAT: [${THAT}]" echo echo THAT: [\${THAT}] echo ------------------- echo THAT: [${THAT}] Code:
$ sh this-that "THIS: [${THIS}]" ------------------- THIS: [ aa bb cc dd ee ff] THIS: [${THIS}] ------------------- THIS: [ aa bb cc dd ee ff] "THAT: [${THAT}]" ------------------- THAT: [ zz yy xx ww ] THAT: [${THAT}] ------------------- THAT: [ zz yy xx ww ]
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
Tags |
echo, quotes, sh whitespace |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interrupt storm and irq madness | siffland | FreeBSD General | 5 | 23rd October 2009 05:16 AM |
escape single quote in sed | gosha | Programming | 5 | 9th March 2009 10:22 AM |