aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/faq.hdr
diff options
context:
space:
mode:
authorGravatar David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au>2013-05-23 13:58:16 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-05-24 23:02:29 -0700
commit2ef912674415c59c9479965373f816f13fbdb332 (patch)
tree8f2a8c65af8fccdbcb40a0e39957439cfbb5949a /doc_src/faq.hdr
parent1d2cd99e961ad350c85e785192388410c230eb8a (diff)
FAQ: address local variable/env usage
Diffstat (limited to 'doc_src/faq.hdr')
-rw-r--r--doc_src/faq.hdr18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc_src/faq.hdr b/doc_src/faq.hdr
index 0da40b49..449c10f4 100644
--- a/doc_src/faq.hdr
+++ b/doc_src/faq.hdr
@@ -6,6 +6,7 @@
- <a href='#faq-cmd-history'>How do I run a command from history?</a>
- <a href='#faq-subcommand'>How do I run a subcommand? The backtick doesn't work!</a>
- <a href='#faq-exit-status'>How do I get the exit status of a command?</a>
+- <a href='#faq-single-env'>How do I set an environment variable for just one command?</a>
- <a href='#faq-customize-colors'>How do I customize my syntax highlighting colors?</a>
- <a href='#faq-update-manpage-completions'>How do I update man page completions?</a>
- <a href='#faq-cwd-symlink'>Why does cd, pwd and other fish commands always resolve symlinked directories to their canonical path?</a>
@@ -77,6 +78,23 @@ other shells.
<hr>
+\section faq-single-env How do I set an environment variable for just one command?
+
+<i><tt>SOME_VAR=1 command</tt> produces an error: <tt>Unknown command "SOME_VAR=1"</tt>.</i>
+
+Use the \c env command.
+
+<tt>env SOME_VAR=1 command</tt>
+
+You can also declare a local variable in a block:
+
+<pre>begin
+ set -lx SOME_VAR 1
+ command
+end</pre>
+
+<hr>
+
\section faq-customize-colors How do I customize my syntax highlighting colors?
Use the web configuration tool,