in reply to The question hpunixguy2 was too scared to ask - How does he quote shell meta characters
Don’t escape particular characters. Protect any single quotes found in the data and then surround the whole string with single quotes, instead.
while ( <DATA> ) { chomp; s/'/'\\''/g; print "'$_'\n"; }
That is so simple you cannot get it wrong.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The question hpunixguy2 was too scared to ask - How does he quote shell meta characters (simple)
by tye (Sage) on Mar 12, 2006 at 07:27 UTC | |
by Aristotle (Chancellor) on Mar 12, 2006 at 19:49 UTC | |
by tye (Sage) on Mar 12, 2006 at 21:21 UTC |