Penguin

Differences between version 54 and previous revision of BashNotes.

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

Newer page: version 54 Last edited on Wednesday, April 18, 2007 11:20:35 am by BenStaz Revert
Older page: version 53 Last edited on Tuesday, April 17, 2007 8:07:59 pm by BenStaz Revert
@@ -398,12 +398,21 @@
 if [ $bla -eq 1 -o $cars -eq 3 -o $monkeys -eq 4 ]; then 
  echo "Westside" 
 fi 
 </verbatim> 
+  
+!How can I supply filenames with a prefix of '-' '--' as arguments to a program?  
+  
+Say you have a file called '--test'.  
+If you wanted to use vim to edit this file then you would do:  
+  
+*vim -- --test  
+  
+The '--' tells the command that what follows is an argument, NOT to interpret them as options.  
  
 !! See also 
  
 * CommonErrors, under "Your shell hangs" 
 * BashOneLiners 
 * SpacesInPathNames 
 * PortabilityNotes 
 * [bash reference manual|http://www.gnu.org/software/bash/manual/bashref.html]