GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CONTAINS (1)

NAME

contains -- test if a word is present in a list

    Synopsis

contains [OPTIONS] KEY [VALUES...]

    Description

contains tests whether the set VALUES contains the string KEY. If so, contains exits with status 0; if not, it exits with status 1.

The following options are available:

o -i or --index print the word index

Note that, like GNU tools, contains interprets all arguments starting with a - as options to contains, until it reaches an argument that is -- (two dashes). See the examples below.

    Example

for i in ~/bin /usr/local/bin if not contains $i $PATH set PATH $PATH $i end end

The above code tests if ~/bin and /usr/local/bin are in the path and adds them if not.

function hasargs if contains -- -q $argv echo ’$argv contains a -q option’ end end

The above code checks for -q in the argument list, using the -- argument to demarcate options to contains from the key to search for.

Search for    or go to Top of page |  Section 1 |  Main Index


Version 2.2.0 CONTAINS (1) Mon Jul 6 2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.