2006-10-31 15:23:16 +00:00
|
|
|
\section contains contains - test if a word is present in a list
|
2006-01-26 17:34:37 +00:00
|
|
|
|
|
|
|
\subsection contains-synopsis Synopsis
|
|
|
|
<code>contains [OPTIONS] KEY [VALUES...]</code>
|
|
|
|
|
|
|
|
\subsection contains-description Description
|
|
|
|
|
2012-07-08 10:53:12 +00:00
|
|
|
- \c -i or \c --index print the the word index
|
2006-01-26 17:34:37 +00:00
|
|
|
- \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
|
2013-02-11 19:06:13 +00:00
|
|
|
set PATH \$PATH \$i
|
2006-01-26 17:34:37 +00:00
|
|
|
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.
|