Bourne shell script

I need a bourne shell script that reads a test case from the input
data file and compare it to its corresponding output. If there is a
difference,the script must print the line number of the input test
case in a result file. Script output and the expected output( givenin
a file called output.txt ) must be compared using "diff" utility.

The purpose of thisscript is black box testing:

thank you in advance
0
ibbu79
7/22/2003 7:21:46 PM
comp.unix.shell 15368 articles. 0 followers. Post Follow

1 Replies
334 Views

Similar Articles

[PageSpeed] 55

Excluded_Middle wrote:

> Alan Connor <xxxxxx@xxxx.xxx> wrote in message news:<klgTa.16937$Mc.1287821@newsread1.prod.itd.earthlink.net>...
> 
>>On 22 Jul 2003 12:21:46 -0700, Excluded_Middle <ibbu79@hotmail.com> wrote:
>>
>>>I need a bourne shell script that reads a test case from the input
>>>data file and compare it to its corresponding output. If there is a
>>>difference,the script must print the line number of the input test
>>>case in a result file. Script output and the expected output( givenin
>>>a file called output.txt ) must be compared using "diff" utility.


If the program to test reads from standard input:

#!/bin/ksh

integer line=0
while read test_case; do
   print -- "$test_case" |
   program_to_test |
   diff expected_output_file - |
   sed -e "s/^/line number $line: /"
   ((integer += 1))
done < input_data_file

If the program to test reads command line arguments, replace

   print -- "$test_case" | program_to_test | ...

with

   program_to_test $test_case | ...


>>I am going to save you, perhaps, from getting your ears boxed here:
>>
>>This ng is not a script dispensary, but, actually, a college of sorts, where
>>shell masters teach. (and some novices, like me, occassionally play at it :-)
>>
>>If you just want a script but don't want to learn shell scripting, then hire
>>one of the pros here.
> 
> People like you can help me alot by not participating in the
> discussion. If you don't know the how to do it then please don't reply
> to the group.


You're the one who doesn't know how to do it, or how to go about
asking for help doing it.


>>Otherwise, work through one of the many fine tutorials available*, do the best
>>you can at writing the script you want, THEN post it and ask for help.
> 
> I'll do that even if you don't advise me but everything take some
> time.


You posted before you even took the time to do `man diff`.


-- 
Kevin Rodgers

0
Kevin
7/23/2003 11:51:57 PM
Reply:

Similar Artilces:

web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps
http://www.hostrazor.net/ web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps -- questo articolo e` stato inviato via web dal servizio gratuito http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it ...

Bourne shell script to determine users shell
All, As root, I would like to get the shell and home directory of any user. I know I can grep it out of /etc/passwd -OR- ypcat passwd but what if the authentication is via ldap? What I am looking for is a implementation similar to getpwent() system call. Is it possible in bourne shell? Please explain. Chandrashekar Tippur In article <1111008774.484325.132650@o13g2000cwo.googlegroups.com>, "Shekar" <ctippur@msn.com> writes: > All, > > As root, I would like to get the shell and home directory of any user. > I know I can grep it out of /etc/passwd -OR- ypcat...

execute a shell script in a shell script
Please help. I have been stumbled on this issue, please see below. I am unable to execute a shell script in a shell script. I need to use perl script but not others and have tried eval, -exec and other on perl script but failed. system"cleartool setview -exec \"cleartool describe -fmt 'On %Sd modified %En and comment:\n %c\n\n' /myproject/vob/myprogram.C\" my_lag "; tks. On Dec 3, 8:30 am, moongeegee <moongee...@gmail.com> wrote: > Please help. > I have been stumbled on this issue, please see below. I am unable to > execute a shell script in a shel...

Shell shell
hello could anyone help me with such problem I would like to have the class in which I will prepare new window to display.. I want to do it as a shell.... How could I return created shell from that class?? many thanks "uzi" <wojciech.ulasW_ytn_I_JTO@op.pl> wrote in message news:dlih8c$1qm$1@news.onet.pl... > hello > > could anyone help me with such problem > > I would like to have the class in which I will prepare new window to > display.. > I want to do it as a shell.... > > How could I return created shell from that class?? "Sh...

Convert Bash shell script to Korn shell script
The following bash script works fine to delete all files that are older than $1 minutes. To execute this script, bash cleanup +10 find /mypath -type f -cmin $1 -exec rm -f {} \; Unfortunately, now I just realize I need to make it work in Korn Shell. Even I change the header from #!/bin/bash to #!/usr/bin/ksh, and execute the script by ksh cleanup +10, it still have different errors: cleanup[9]: -cmin: not found. cleanup[10]: -type: not found. Looks like it doesn't work anymore. I think I need to re-write the Korn Shell script that do the task. I tried to search for equivalent Korn ...

Convert Bash shell script to Korn shell script
The following bash script works fine to delete all files that are older than $1 minutes. To execute this script, bash cleanup +10 find /mypath -type f -cmin $1 -exec rm -f {} \; Unfortunately, now I just realize I need to make it work in Korn Shell. Even I change the header from #!/bin/bash to #!/usr/bin/ksh, and execute the script by ksh cleanup +10, it still have different errors: cleanup[9]: -cmin: not found. cleanup[10]: -type: not found. Looks like it doesn't work anymore. I think I need to re-write the Korn Shell script that do the task. I tried to search for equivalent Korn ...

handling SIGINT in shell scripts when executing another shell script.
I have a simple shell script foo1.sh that invokes another shell script foo2.sh, something like below: #!/bin/sh SIGINT_handler() { echo "## [$DATE_TIME] User interrupt ignored," continue } trap SIGINT_handler 2 .... ../foo2.sh .... ---------- while executing foo1.sh, if the script receives SIGINT, how do I ignore the SIGINT in foo2.sh ? somehow foo2.sh does not finish to completion and is killed after receiving SIGINT. but foo1.sh is still executing. Is there any way to trap this signal in the child script. ? Please share your thots and inputs on this topic. Regards, Vikram S...

Writing Shell script to interactively control another shell script??
Using Solaris, Say you want to write a shell script to control another simple menu entry shell script like the following testscript.sh file /////////////////////// themenu() { echo "MENU" echo "1 - Check Status and other stuff " echo "2 - Run program" echo "3 - Exit" echo "" } while true do themenu read input case $input 1) //check status and do some other stuff ;; 2) //start program and other background processes;; 3) break;; //exit loop and program *) ;; done ////////////////////////////////////////////////////////////////// What I wan...

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]
I've noticed the shell-script-mode I get with Emacs behaves differently from that which I get with XEmacs. In particular the Emacs version provides a hard indentation feature (I don't know the formal term for hitting Tab to indent code to reflect the syntactic structure, but that's what I mean). Can I configure XEmacs (latest CVS) to support hard indentation when editing bash scripts? -- p->m == (*p).m == p[0].m >>>>> "Hattuari" == Hattuari <susudata@setidava.kushan.aa> writes: Hattuari> Can I configure XEmacs (latest CVS) to ...

pg_dumpall shell script in bash shell
I am pretty much stumped atm and am hoping someone can shed some light for me. I am attempting to write a set of automated BASH Shell Scripts that tie in with PostgreSQL and PHP to manage our backups. There are a few teething troubles the main one is that when psql calls out the names of the databases to feed them into a shell script array it feeds them in as one value EG: dbname1 dbname2 dbname3 etc and they are all stored within the array value $dbname[0] when I want dbname1 stored in $dbname[0] and dbname2 stored in $dbname[1] etc In the original version I just defined all the databases ...

bourne shell script
is there a way to test that something work ie if I diff 2 files is there any way in the script to tell if the files were the same Greg wrote: > is there a way to test that something work ie if I diff 2 files is there any > way in the script to tell if the files were the same Thats what program return codes are for; diff has the following return codes: 0 No differences were found. 1 Differences were found. >1 An error occurred. After executing a program, it's return code is stored in the $? variable, so: #!/bin/sh diff a b > /dev/null i...

unix shell script
Hi all, I am in need of a shell script which will cat all the audit files into one log and then email. Thanks. Muddu "muddu" <mudassar.dba@gmail.com> wrote in message news:1156371761.252866.267670@b28g2000cwb.googlegroups.com... > Hi all, > > I am in need of a shell script which will cat all the audit files into > one log and then email. > "cat *.aud" will merge all files together. You can redirect it to a file and/or email. Thank you very much for your hint. Regards. Muddu Bob Jones wrote: > "muddu" <mudassar.dba@gmail.com&...

how to run your tcsh shell script in the new shell
example : echo test1 tcsh echo test2 output ==> test1 1. seem that the "echo test 2" is not running, my question is how to run the shell script in this new tcsh. 2. can i also run my shell script in new, xterm or new machine (with command rsh) ? Lim kiang Leng wrote: > example : > > echo test1 > tcsh > echo test2 > > output ==> test1 > > 1. seem that the "echo test 2" is not running, my question is how to > run the shell script in this new tcsh. > > 2. can i also run my shell script in new, xterm or new machine (with > ...

Bourne shell: Executing a list in a separate shell
Hello netties, guess that the solution is really straightforward, but may be I am just too blind at the moment: I want to run a list of commands by executing a new Bourne shell instance on one line. My testcode looks as follows: > cat testscript.sh echo hello TESTVAR="This is a test" export TESTVAR When I run a new shell and supply the list "manually" to the shell I can comprise them using braces without problems: > /bin/sh > { . testscript.sh ; echo $TESTVAR; } hello This is a test If I try to do it "in one run" it does not work as I would like it ...

Process id of parent shell from shell script
Hi, $$ gives process id of current shell. How to get process id of parent shell. Thanks Sujit sujit wrote: > Hi, > > $$ gives process id of current shell. How to get process id of parent > shell. > > Thanks > Sujit > From man sh Shell Variables The following variables are set by the shell: PPID The process ID of the shell's parent. This variable is read-only. -Vino. On 2006-04-07, sujit wrote: > Hi, > > $$ gives process id of current shell. How to get process id of parent > shell. What shell are you using? Some ...

How to use shell variable in a kermit shell script
Hi, In a kermit shell script doing FTP transfert, between 1 master server to many slave, I need to use values stored in shell environment variable. How can I do this? Best regards, frederic, Frederic, You can simply echo the var to a file, then read the contents of the file, parsing if necessary depending on the o/s. From WinXP: [C:\] K-95> run set temp > file [C:\] K-95> type file TEMP=C:\DOCUME~1\xxx\LOCALS~1\Temp There are probably more elegant ways as well, that I'll learn when Frank pops his infinite wisdom out here :) "Frederic&...

shell script as a startup shell in /etc/password?
Hi, I am trying to start a shell script at user login by putting the shell script in the /etc/password file like this: foo:x:456:1::/home/foo:/space/foo/myshell The script myshell is a one liner that starts up a script session for terminal logging: #!/usr/bin/bash /usr/ucb/script /tmp/typescript But when I try to log into the system as foo, I just see a bunch of script processes getting created and then dying. Any ideas as to what is happening? Using Solaris 10, linux had similar results. $ ssh localhost -l admin Password: Last login: Mon Sep 11 09:32:45 2006 from localhost Script starte...

bourne shell script help
Greetings, I'm trying to write a script that will find the executable files, but not directories, in a user's path statement. Does anyone have a starting point or a differing perspective than what I have here? I'm having difficulty getting this to run. Thanks in advance! #!/bin/sh # set a flag to check if you should search all for all ocurrences of the command # by default only find the first occurance FINDALL=FALSE while: do case $1 in $PATH -a) FINDALL=TRUE shift # throw away this argument ;; -h) echo "Usage: $0 [ -a ] comm...

To pratice Unix shell scripts
Hello guys, I think this question has been asked several times before on the list but I did not see any definate answer , what I want to is learn shell scripting which might helpfull for SAS skills but I do not know a place where I can do it. What I am looking is , is there a place online like free shell praticing web site or any tools which I can download to pratice the scripts . I have seen lot good shell scripts that can be used for SAS on Ronald's web site. Atleast I want pratice them . Or is there version Linux I can install on computer to pratice them . thanks for the advice. Try...

Bourne Shell Scripting with iptables
hey guys. we are working on a new implementation of iptables where our customers can = specify simplified options in a config file. now i need to write a script that will parse the config file, assign all th= e variables, and write all the rules in iptables.=20 the syntax that the customer will use looks like this: accept|drop|reject (in|out) (on <interface> (ipv[46])) (proto <protocol>) (= from (source) port <port>) (to (dest) port <port>) everything between () is optional. so only accept,drop or reject are requir= ed.. thats the tricky thing.. the c...

US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335553540)
US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335553540) ============================================================================================= Position: UNIX Developer Reference: SMC01885 Location: Jersey City NJ Duration: 7M Skills: Knowledge of SwiftAlliance Access. Exp in upgrading/migrating Swift Alliance Access, Swift Alliance Gateway, SwiftNet Link. Knowledge of Compliance and Watchlist filtering applications like Mircosoft. Knowledge of Banking, payment and messaging systems. Exp with Unix, shell Scripting, MQ Series, Oracle, Crystal Reports and WebSphere. Strong analytical skills. Ability to analyze a problem. own the problem and follow thru to resolution. Production support experience with critical systems. Good written and oral communication skills. Scope: Knowledge of Banking, payment and messaging systems. Experience with Unix, shell Scripting, MQ Series, Oracle, Crystal Reports and WebSphere. Strong analytical skills. Ability to analyze a problem. own the problem and follow thru to resolution. Production support experience with critical systems. Good written and oral communication skills. Please send your...

Download Unix Shell Script
Hi, Is there any Unix Shell Scripts tool free to download for windows vista OS. I want to install and practice Unix shell scripts. Thanks JK Gopal wrote: > Hi, > > Is there any Unix Shell Scripts tool free to download for windows > vista OS. I want to install and practice Unix shell scripts. You may want to install the Cygwin package, where you'll find the bash shell included. Then you can also download ksh from kornshell.com. (Haven't tried that on Vista, though, but that works for XP at least.) Janis On Sat, 22 Mar 2008 16:08:06 +0100, Janis Papanagnou wrote: >...

US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335557609)
US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335557609) ============================================================================================= Position: UNIX Developer Reference: SMC01885 Location: Jersey City NJ Duration: 7M Skills: Knowledge of SwiftAlliance Access. Exp in upgrading/migrating Swift Alliance Access, Swift Alliance Gateway, SwiftNet Link. Knowledge of Compliance and Watchlist filtering applications like Mircosoft. Knowledge of Banking, payment and messaging systems. Exp with Unix, shell Scripting, MQ Series, Oracle, Crystal Reports and WebSphere. Strong analytical skills. Ability to analyze a problem. own the problem and follow thru to resolution. Production support experience with critical systems. Good written and oral communication skills. Scope: Knowledge of Banking, payment and messaging systems. Experience with Unix, shell Scripting, MQ Series, Oracle, Crystal Reports and WebSphere. Strong analytical skills. Ability to analyze a problem. own the problem and follow thru to resolution. Production support experience with critical systems. Good written and oral communication skills. Please send your...

US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335814411)
US-NJ-Jersey City: UNIX Developer, UNIX, Shell scripting, SwiftAlliance Access; (45335814411) ============================================================================================= Position: UNIX Developer Reference: SMC01885 Location: Jersey City NJ Duration: 7M Skills: Knowledge of SwiftAlliance Access. Exp in upgrading/migrating Swift Alliance Access, Swift Alliance Gateway, SwiftNet Link. Knowledge of Compliance and Watchlist filtering applications like Mircosoft. Knowledge of B...

Web resources about - Bourne shell script - comp.unix.shell

The Bourne Legacy Movie - Official Site for the The Bourne Legacy Film - In Theaters August 3, 2012
The Bourne Legacy starring Jeremy Renner, Rachel Weisz, Edward Norton, Stacy Keach, and Oscar Isaac continues the thrilling experience of Jason ...

Vanson Bourne: Content Marketing
Research based content marketing for effective sales and marketing communications. Vanson Bourne Home My Vanson Bourne Contact Us - Blog Home ...

Bourne, Massachusetts - Wikipedia, the free encyclopedia
... /  41.74111°N 70.59944°W  / 41.74111; -70.59944 Coordinates : 41°44′28″N 70°35′58″W  /  41.74111°N 70.59944°W  / 41.74111; -70.59944 Bourne ...

Justin Bourne (@jtbourne) on Twitter
Sign in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Justin Bourne @ jtbourne ...

Flickr: Joanna Bourne's Photostream
You aren't signed in Sign In Help Home The Tour Sign Up Explore Explore Home Last 7 Days Interesting Popular Tags Calendar Most Recent Uploads ...

The Bourne Legacy - Official Theatrical Trailer #1 : Jeremy Renner (2012) - YouTube
The narrative architect behind the Bourne film series, Tony Gilroy, takes the helm in the next chapter of the hugely popular espionage franchise ...

Will Bourne Returns to Village Voice as Editor
The Village Voice has brought former editor Will Bourne back for another go at the role. Bourne previously served as the paper’s editor for ...

Matt Damon: Jason Bourne is in a ‘dark and tortured place’ in upcoming ‘Bourne 5’ movie
The fifth installment in the Bourne saga, and the fourth Bourne movie starring Matt Damon, hits theaters on July 29th but we still have no idea ...

Matt Damon is back in the first trailer for the new Jason Bourne movie
We just got a lot of questions answered with the premiere of the new Jason Bourne movie during the Super Bowl. Matt Damon certainly hasn't lost ...

Super Bowl trailers: does ‘Jason Bourne’ look better than ‘Captain America’?
... action by previewing some of their biggest future releases. So at SB50, there were several new trailers and teasers shown. Here’s Jason Bourne ...

Resources last updated: 2/25/2016 9:13:59 PM