mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 04:39:52 +08:00
7a5823fd60
darcs-hash:20060919145203-ac50b-bc87b8f5e6a18395e4bc3e364da4a40ad97850e7.gz
24 lines
573 B
Plaintext
24 lines
573 B
Plaintext
\section contains contains - Test if a word is present in a list
|
|
|
|
\subsection contains-synopsis Synopsis
|
|
<code>contains [OPTIONS] KEY [VALUES...]</code>
|
|
|
|
\subsection contains-description Description
|
|
|
|
- \c -h or \c --help display this message
|
|
|
|
Test if the set VALUES contains the string KEY. Return status is 0 if
|
|
yes, 1 otherwise
|
|
|
|
|
|
\subsection contains-example Example
|
|
<pre>
|
|
for i in ~/bin /usr/local/bin
|
|
if not contains \$i \$PATH
|
|
set PATH \$PATH i
|
|
end
|
|
end
|
|
</pre>
|
|
|
|
The above code tests if ~/bin and /usr/local/bin are in the path and if they are not, they are added.
|