Differences between version 54 and predecessor to the previous major change of BashNotes.
Other diffs: Previous 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 52 | Last edited on Friday, March 16, 2007 8:16:47 pm | by LawrenceDoliveiro | Revert |
@@ -372,8 +372,11 @@
!How can I see what my command will look like after bash expands it?
After typing the command, press ''Esc'' then press ''C-e''
+!Bash C-style for loop construct
+
+for ((i=1; i<100;i++));do echo $i; done;
!How can I do Division in bash using floating point numbers?
Use ''bc''
@@ -395,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]