diff options
| author | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
| commit | 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch) | |
| tree | 158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/bash/is-this-shell-interactive_003f.html | |
| parent | 9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff) | |
| download | dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip | |
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/bash/is-this-shell-interactive_003f.html')
| -rw-r--r-- | devdocs/bash/is-this-shell-interactive_003f.html | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/devdocs/bash/is-this-shell-interactive_003f.html b/devdocs/bash/is-this-shell-interactive_003f.html deleted file mode 100644 index d01a311e..00000000 --- a/devdocs/bash/is-this-shell-interactive_003f.html +++ /dev/null @@ -1,17 +0,0 @@ -<h1 class="subsection">Is this Shell Interactive?</h1> <p>To determine within a startup script whether or not Bash is running interactively, test the value of the ‘<samp>-</samp>’ special parameter. It contains <code>i</code> when the shell is interactive. For example: </p> <div class="example"> <pre class="example">case "$-" in -*i*) echo This shell is interactive ;; -*) echo This shell is not interactive ;; -esac -</pre> -</div> <p>Alternatively, startup scripts may examine the variable <code>PS1</code>; it is unset in non-interactive shells, and set in interactive shells. Thus: </p> <div class="example"> <pre class="example">if [ -z "$PS1" ]; then - echo This shell is not interactive -else - echo This shell is interactive -fi -</pre> -</div><div class="_attribution"> - <p class="_attribution-p"> - Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br> - <a href="https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html</a> - </p> -</div> |
