Article View: comp.unix.programmer
Article #3821Re: Writing a script
From: dongjinkim
Date: Fri, 08 Dec 2000 15:56
Date: Fri, 08 Dec 2000 15:56
57 lines
2797 bytes
2797 bytes
Hi Jody, The basic things you need to know to get started is the following: Parse the command line parameters: $# = number of parameters passed to your program $1 = parameter 1 $2 = parameter 3 etc... You may have to surround variables and parameters in double quotes if they contain more than one word. Use the redirection symbol ">" to redirect the standard output from a process to a new file. Use the append symbol ">>" to append the standard output from a process to an existing file. (It will be created if it doesn't exist.) That should help you get started... Jin In article <3A2E6922.61778861@siliconmetrics.com>, Jody Zung <jzung.zung@siliconmetrics.com> wrote: > Hi folks. I'm new to writing shell scripts in unix so maybe someone > could help me out here. > 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. > > Sent via Deja.com http://www.deja.com/ Before you buy.
Technical Details
Message-ID:
<90r0b3$ld8$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!londen1-snf1.gtei.net!news.gtei.net!diablo.theplanet.net!newsfeed.skycache.com!Cidera!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mailReferences:
<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: 1025b4,447395ef176ca092 X-Google-Attributes: gid1025b4,public X-Google-Thread: 11035d,447395ef176ca092 X-Google-Attributes: gid11035d,public X-Google-ArrivalTime: 2000-12-08 08:10:09 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!londen1-snf1.gtei.net!news.gtei.net!diablo.theplanet.net!newsfeed.skycache.com!Cidera!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: dongjinkim@my-deja.com Newsgroups: comp.unix.programmer,comp.unix.solaris,gnu.misc.discuss Subject: Re: Writing a script Date: Fri, 08 Dec 2000 15:56:24 GMT Organization: Deja.com - Before you buy. Lines: 57 Message-ID: <90r0b3$ld8$1@nnrp1.deja.com> References: <3A2E6922.61778861@siliconmetrics.com> NNTP-Posting-Host: 206.221.244.80 X-Article-Creation-Date: Fri Dec 08 15:56:24 2000 GMT X-Http-User-Agent: Mozilla/4.7 [en] (X11; U; SunOS 5.5.1 sun4u) X-Http-Proxy: 1.0 x52.deja.com:80 (Squid/1.1.22) for client 206.221.244.80 X-MyDeja-Info: XMYDJUIDdongjinkim