Penguin

Differences between version 52 and predecessor to the previous major change of BashNotes.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 52 Last edited on Friday, March 16, 2007 8:16:47 pm by LawrenceDoliveiro Revert
Older page: version 51 Last edited on Monday, March 12, 2007 8:44:55 pm by BenStaz Revert
@@ -359,8 +359,16 @@
 END_SCRIPT 
 </verbatim> 
  
 â€”AristotlePagaltzis 
+  
+LawrenceDoliveiro's so-simple-you'll-kick-yourself-for-not-thinking-about-it answer:  
+  
+<verbatim>  
+ssh site sed -i -e $(printf %q 's/OPTIONS=.*/OPTIONS="foo"/') file  
+</verbatim>  
+  
+using Bash's <tt>printf</tt> builtin.  
  
 !How can I see what my command will look like after bash expands it? 
  
 After typing the command, press ''Esc'' then press ''C-e'' 
@@ -394,4 +402,5 @@
 * CommonErrors, under "Your shell hangs" 
 * BashOneLiners 
 * SpacesInPathNames 
 * PortabilityNotes 
+* [bash reference manual|http://www.gnu.org/software/bash/manual/bashref.html]