🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3816

Re: Writing a script

#3816
From: Griff Miller
Date: Wed, 13 Dec 2000 18:29
44 lines
2690 bytes
Jody Zung wrote:
> 
> Hi folks. I'm new to writing shell scripts in unix so maybe someone
> could help me out here.

I'm going to assume that you mean Bourne shell scripts.  (/bin/sh)

I recommend that you get a good book on the subject. Portable Shell
Programming by Blinn is my favorite.

> I'm lookin to run some automated test cases. What I need to do is run a
> process and output the results. Actually there is more I need to do but
> I need to walk before I can run.
> 
> So basically it'll look like this.
> 
> I have a process called OMC that I run on a file. There are options as
> well, so a command from the unix prompt would look like this:
> 
> omc  -dtmlckf -o <output dir> <filename.lib>
>
> Then the thing runs for a while and ouputs a huge amount of stuff.
> After this I want to check the output directory for the correct files.
> 
> So i'll cd to the output directory, do an ls, or ll and visually check
> for the needed files.
> 
> Is there a way i can do all of this in a script and output to a results
> file??
> 
> thanks in advance.

#!/bin/sh

omc  -dtmlckf -o /some/dir filename.lib >/tmp/savedoutput 2>&1
(cd /some/dir && ls -la) >>/tmp/savedoutput 2>&1

exit

-- 
Griff Miller II
Manager of Information Technology      "Beware of those who seek to win an
Positron Corporation                    argument at the expense of the
griff.miller@positron.com               language."  -Paul Johnson
Technical Details
Message-ID: <3A37C010.F9C16B53@positron.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!cyclone.news.idirect.com.MISMATCH!newsfeed.direct.ca!look.ca!feed3.news.psi.net!psinr!filter.news.psi.net!reader.dist.news.psi.net!client!not-for-mail
References: <3A2E6922.61778861@siliconmetrics.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,447395ef176ca092
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 11035d,447395ef176ca092
X-Google-Attributes: gid11035d,public
X-Google-Thread: 1025b4,447395ef176ca092
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 2000-12-13 10:30:55 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!cyclone.news.idirect.com.MISMATCH!newsfeed.direct.ca!look.ca!feed3.news.psi.net!psinr!filter.news.psi.net!reader.dist.news.psi.net!client!not-for-mail
Message-ID: <3A37C010.F9C16B53@positron.com>
From: Griff Miller <griff.miller@positron.com>
Organization: Positron Corporation
X-Mailer: Mozilla 4.72 [en] (X11; U; SunOS 5.6 sun4u)
X-Accept-Language: en-US, en
MIME-Version: 1.0
Newsgroups: comp.unix.programmer,comp.unix.solaris,gnu.misc.discuss
Subject: Re: Writing a script
References: <3A2E6922.61778861@siliconmetrics.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 44
Date: Wed, 13 Dec 2000 12:29:36 -0600
NNTP-Posting-Host: 38.197.24.7
X-Trace: client 976732183 38.197.24.7 (Wed, 13 Dec 2000 13:29:43 EST)
NNTP-Posting-Date: Wed, 13 Dec 2000 13:29:43 EST