[Home]
HomePage RecentChanges Frequently Asked Questions

Shellquote

This function ensures that strings you use as arguments to the system() function (or "cmd"|getline commands) are safely quoted. First, all single quotes are converted to '\'', and finally, the argument is wrapped in single quotes.

function shellquote(str) {
 gsub(/'/, "'\\''", str)
 return sprintf("'%s'", str)
}

Edit this page View other revisions Administration
Last edited 2009年03月01日 00:35 UTC by h-67-101-152-180.nycmny83.dynamic.covad.net

Powered by sdf Creative Commons License <pierre.gaston+awk@gmail.com>

Awk Wiki by #awk is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

AltStyle によって変換されたページ (->オリジナル) /