Bash Command Line: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://www.tldp.org/LDP/abs/html/bash-options.html =Internal= * bash =bash Command Line Options= ==-c== Start a non-interactive shell, whi...")
 
Line 6: Line 6:


=bash Command Line Options=
=bash Command Line Options=
==--==
End of options. Anything further on the command line is an argument, not an option.


==-c==  
==-c==  


Start a non-interactive shell, which executes the
Start a non-interactive shell, which executes the string that follows <code>-c</code>. To avoid the shell that executes the bash invoked with -c to perform [[Bash Command Line Expansion|command line expansion]], the string should be enclosed in single quotes:
 
<syntaxhighlight lang='bash'>
bash -c 'i=0; echo $i'
</syntaxhighlight>
 
==--version==

Revision as of 02:05, 14 March 2020

External

Internal

bash Command Line Options

--

End of options. Anything further on the command line is an argument, not an option.

-c

Start a non-interactive shell, which executes the string that follows -c. To avoid the shell that executes the bash invoked with -c to perform command line expansion, the string should be enclosed in single quotes:

bash -c 'i=0; echo $i'

--version