for professionalsolutions

profileCoolcaliber
Linuxassignment1.zip

Linux assignment 1/Assignment 1 details.docx

Assignment 1

The example output in the links above show the results of a program run through a series of tests.The examples show what the PATH environment variable was set to for the test case, the command that was run, the expected results and the output of the program.

PATH ==> /usr/bin:/usr/local/bin:/usr/bin/X11

RAN ==> mar1.sh -a tar

RESULT ==> PASSED

EXPECTED RESULT ==> /usr/bin/tar

PROGRAM OUTPUT ==> /usr/bin/tar

You script will should out put the results (the data after the ==> in the EXPECTED RESULT) section.

Write a shell script to locate executable files. This script takes a list of file names from the command line and determines which would be executed had these names been given as commands.

· The search path should be based only on the user's PATH environment variable.  You shall not use  the Unix  which command, the ksh  whence (type) command, the  locate command, or the bash  type command. 

· The code for the script shall not use the UNIX ls command to determine if the file is executable or if it exists.

· The script should find only the first occurrence of the "file". If the file is not found, the script  the following

<command> NOT FOUND

<command> would be replaced by the name of the "file" you didn't find.

· If the first parameter is '-a', then the script should print all occurrences of the executable file in the user's path. Again if the file was not on the path, an error message should be displayed.

· The find command shall not be used.

· A project using  temporary files will not be graded.

Note:

· The shell variable PATH defines the search path for the directory containing the command. Alternative directory names are separated by a colon (:). The current directory can be specified by two or more adjacent colons, or by a colon at the beginning or end of the path list.

· If the command name contains a / then the search path is not used, you just check if the command/file specified is executable and not a directory. Otherwise, each directory in the path is searched for an executable file.

usage: mywhich [-a] command ....

Examples: The locations of these programs may vary on different systems and the users PATH environment variable.

prompt> mywhich ls /bin/ls

prompt> mywhich -a cc /bin/cc /usr/ucb/cc

prompt> mywhich ./mywhich ./mywhich

prompt> mywhich /bin/ls /bin/ls

prompt> mywhich fooblar fooblar not found

prompt> mywhich ksh sh csh bash /usr/bin/ksh /bin/sh /bin/csh /usr/local/bin/bash

The PDF file (in the folder that says Assignment 1 example pdf) has a flow chart example of how to program Assignment 1.

Here is some psuedo code:

BEGIN      set FINDALL to false     IF $1 equals -a THEN         set FINDALL to TRUE         dispose of $1     END-IF     FOR each Positional Parameter ($file) DO         IF $file is a pathname THEN             IF if $file is executable and not a directory THEN                 echo $file             ELSE                 echo $file  is NOT Found             END-IF         ELSE             set FOUND to false             # Don't forget to handle the special cases of PATH             FOR  P in PATH (: separated list) DO                 IF $P/$file is executable and not a directory THEN                     set FOUND to true                     echo $P/$file                     IF FINDALL is FALSE THEN                         BREAK FROMTHE for  LOOP                     END-IF                 ELSE                 END-IF                 IF FOUND is FALSE THEN                     echo $file is NOT FOUND                 END-IF             END-FOR         END-IF     END-FOR END

Linux assignment 1/output for the program/Assignment1-Example(1).pdf

Project 1 Michael Richards

Page 1 of 190-312-061

February 23, 2014

START main

set FINDALL to false

$1 equals -a

T

F set

FINDALL to TRUE

dispose of $1

For each Positional Parameter

$file

T

F

$file is a pathname

T F

if $file is executable and not a

directory

T F

echo $file echo $file

is NOT Found

set FOUND to false

# Don't forget to handle the special cases

of PATH

For P in PATH (: separated

list)

T

F

$P/$file is executable and not a

directory

T F

set FOUND to true

echo $P/$file

FINDALL is FALSE

T

F BREAK

FROMTHE for LOOP

FOUND is FALSE

T

F

echo $file is NOT FOUND

shift

STOP main

Linux assignment 1/output for the program/output.pdf

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 1/16

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./tar not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh /bin/tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar ls sleep 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

/bin/ls 

/bin/sleep 

PROGRAM OUTPUT  ==> /bin/tar 

/bin/ls 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 2/16

/bin/sleep 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> mar1.sh not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./class 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND (this is a directory) 

PROGRAM OUTPUT  ==> ./class not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 3/16

RAN    ==> mar1.sh no‐read 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐read not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh any‐old‐file 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> any‐old‐file not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./tar 

RESULT ==> PASSED 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 4/16

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./tar not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh /bin/tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar ls sleep 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

/bin/ls 

/bin/sleep 

PROGRAM OUTPUT  ==> /bin/tar 

/bin/ls 

/bin/sleep 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./mar1.sh 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 5/16

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> skekek not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./skekek not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./class 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND (this is a directory) 

PROGRAM OUTPUT  ==> ./class not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh no‐read 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐read not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 6/16

PROGRAM OUTPUT  ==> ./no‐execute not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐execute not FOUND 

PATH   ==> :/bin:/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh any‐old‐file 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> any‐old‐file not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./tar not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 7/16

RAN    ==> mar1.sh /bin/tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh tar ls sleep 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

/bin/ls 

/bin/sleep 

PROGRAM OUTPUT  ==> /bin/tar 

/bin/ls 

/bin/sleep 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> skekek not FOUND 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 8/16

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./skekek not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./class 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND (this is a directory) 

PROGRAM OUTPUT  ==> ./class not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh no‐read 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐read not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh ./no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./no‐execute not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐execute not FOUND 

PATH   ==> /bin::/usr/local/bin:/usr/bin/X11 

RAN    ==> mar1.sh any‐old‐file 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 9/16

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> any‐old‐file not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ./tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./tar not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh /bin/tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh tar ls sleep 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 10/16

/bin/ls 

/bin/sleep 

PROGRAM OUTPUT  ==> /bin/tar 

/bin/ls 

/bin/sleep 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ./mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ./skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ./class 

RESULT ==> PASSED 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 11/16

EXPECTED RESULT ==> NOT FOUND (this is a directory) 

PROGRAM OUTPUT  ==> ./class not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh no‐read 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐read not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh ./no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11: 

RAN    ==> mar1.sh any‐old‐file 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> any‐old‐file not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 12/16

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ./tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./tar not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh /bin/tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh tar ls sleep 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

/bin/ls 

/bin/sleep 

PROGRAM OUTPUT  ==> /bin/tar 

/bin/ls 

/bin/sleep 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 13/16

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ./mar1.sh 

RESULT ==> PASSED 

EXPECTED RESULT ==> ./mar1.sh 

PROGRAM OUTPUT  ==> ./mar1.sh 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ./skekek 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./skekek not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ./class 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND (this is a directory) 

PROGRAM OUTPUT  ==> ./class not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh no‐read 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐read not FOUND 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 14/16

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh ./no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> ./no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh no‐execute 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> no‐execute not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh any‐old‐file 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> any‐old‐file not FOUND 

PATH   ==>  /opt/SUNWspro/bin:/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/opt/sfw/bin:/usr/sfw/bin:.:/usr/c cs/bin:/usr/ucb:/usr/platform/SUNW,Sun‐Fire‐ V240/sbin:/sbin:/usr/sbin:/usr/local/sbin:/usr/sadm/bin:/usr/lib:/usr/platform/sun4u/sbin 

RAN    ==> mar1.sh ls 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/ls 

PROGRAM OUTPUT  ==> /bin/ls 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh x1banner 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> x1banner not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 15/16

RAN    ==> mar1.sh tcc2 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> tcc2 not FOUND

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh tcc3 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> tcc3 not FOUND

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh mar1.sh1 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND 

PROGRAM OUTPUT  ==> mar1.sh1 not FOUND 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:/users/faculty/mrichard/example:. 

RAN    ==> mar1.sh "do it" 

RESULT ==> PASSED 

EXPECTED RESULT ==> /users/faculty/mrichard/example/do it 

PROGRAM OUTPUT  ==> /users/faculty/mrichard/example/do it 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:. 

RAN    ==> mar1.sh "/users/faculty/mrichard/example/do it" 

RESULT ==> PASSED 

EXPECTED RESULT ==> /users/faculty/mrichard/example/do it 

PROGRAM OUTPUT  ==> /users/faculty/mrichard/example/do it 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:/users/faculty/mrichard/example:. 

RAN    ==> mar1.sh "do it" ls 

RESULT ==> PASSED 

EXPECTED RESULT ==> /users/faculty/mrichard/example/do it 

10/17/2017 https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt

https://uml.umassonline.net/bbcswebdav/pid­916182­dt­content­rid­4615041_1/courses/INFO.3120.061.FA17/mar1.sh.ub.txt 16/16

/bin/ls 

PROGRAM OUTPUT  ==> /users/faculty/mrichard/example/do it 

/bin/ls 

PATH   ==> /bin:/usr/local/bin:/usr/bin/X11:/users/faculty/mrichard/example:. 

RAN    ==> mar1.sh class 

RESULT ==> PASSED 

EXPECTED RESULT ==> NOT FOUND file is a directory 

PROGRAM OUTPUT  ==> class not FOUND 

PATH   ==>  /opt/SUNWspro/bin:/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/opt/sfw/bin:/usr/sfw/bin:.:/usr/c cs/bin:/usr/ucb:/usr/platform/SUNW,Sun‐Fire‐ V240/sbin:/sbin:/usr/sbin:/usr/local/sbin:/usr/sadm/bin:/usr/lib:/usr/platform/sun4u/sbin 

RAN    ==> mar1.sh ‐a tar 

RESULT ==> PASSED 

EXPECTED RESULT ==> /bin/tar 

PROGRAM OUTPUT  ==> /bin/tar 

PASSED ==> 80         100%       

FAILED ==> 0          0%