aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/contains.txt
blob: b785c9b90feff3181b125ac146f6f64c3600ecb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\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.