🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: ca.unix
Article #1127

Re: shellscript???

#1127
From: Dale DePriest
Date: Wed, 01 Jun 1994 21:24
33 lines
1647 bytes
In article <446_9405232211@sasbbse.com>, Tim.Pesce@1.sasbbse.com (Tim Pesce) writes:
|> In article <jorcasCq6Gx5.AI1@netcom.com>,
|> Jorge E Castillo Jr <jorcas@netcom.com> wrote:
|> >How do I chek if a shell script has received arguments (that $1 exists).
|> 
|> First of all, it will depend on the shell you are using.  I am assuming
|> you are using the Bourne shell.
|> 
|> You can query the $# variable.  This is the number of command-line
|> arguments passed to the shell script.
|> 
|> Hope this helps!

Every programming method has at least two solutions.
Another usefull technique is to use quotes.

	if [ "$1" = "" ]
	then  ...
 
|> -- 
|> Tim Pesce
|> tpesce@kaiwan.com
|> --
|> |Fidonet:  Tim Pesce 1:103/1
|> |Internet: Tim.Pesce@1.sasbbse.com
|> |
|> | Standard disclaimer: The views of this user are strictly his own.
|> 

-- 
    _      _     Dale DePriest  		San Jose, California
   /`) _  //     daled@Cadence.COM		voice: (408) 428-5249
 o/_/ (_(_X_(`	 				fax: (408) 943-0402
Technical Details
Message-ID: <CqqM4u.E29@Cadence.COM>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!rtp.vnet.net!news1.digex.net!uunet!nntp.cadence.com!cds9172.Cadence.COM!daled
References: <446_9405232211@sasbbse.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10183f,dea6746deb3cf8b5
X-Google-Attributes: gid10183f,public
X-Google-ArrivalTime: 1994-06-04 20:51:52 PST
Newsgroups: ca.unix
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!rtp.vnet.net!news1.digex.net!uunet!nntp.cadence.com!cds9172.Cadence.COM!daled
From: daled@cds9172.Cadence.COM (Dale DePriest)
Subject: Re: shellscript???
Message-ID: <CqqM4u.E29@Cadence.COM>
Sender: news@Cadence.COM
Nntp-Posting-Host: cds9172.cadence.com
Organization: Cadence Design System, Inc.
References:  <446_9405232211@sasbbse.com>
Date: Wed, 1 Jun 1994 21:24:29 GMT
Lines: 33