%expand%
qa=`perl -e 'for (@ARGV) {s/(["\\$])/\\\\$1/g; $_="\"$_\"";} print join(" ", @ARGV)' "$@"`
ssh remote-server "cd /some/where; do something; $qa"
qa=`perl -e "for (@ARGV) {s/'/'\\\\\''/g; \\\$_=\"'\\\$_'\";} print join(' ', @ARGV);" "$@"`
Labels: perl, programming
}))| Bracing against the wind | |
| www.documentroot.com |
|
Thursday, May 08, 2008
Useful Line for Quoting Shell Arguments
Single quote version is safer, but is harder for me to read. Labels: perl, programming [View/Post Comments] [Digg] [Del.icio.us] [Stumble] |
|
Bloghop:
|
Blogarama
|
Technorati
|
Blogwise