princem3
10-14-2003, 09:14 PM
I've got a couple of short scripts to explain and these should be easy enough for anyone who knows Unix / linux so please help.
Explain the following:
#!/bin/sh
file=$1
shift
vi `grep -l "$file" "$@"`
This one is the real doozy.. but here goes.
Given the following shell scripts
outer
--------------------------------------------------------------------------------
#!/bin/sh
echo $#
inner $*
inner "$@"
inner "$*"
--------------------------------------------------------------------------------
inner
--------------------------------------------------------------------------------
#!/bin/sh
echo $#
and the following command lines
--------------------------------------------------------------------------------
prompt> outer
prompt> outer 1 2 3
prompt> outer "1 2 3"
prompt> outer "A B" "C D"
prompt> outer "Hello Class, this is not too hard"
prompt> outer " "
--------------------------------------------------------------------------------
Fill in the following table
$# Call to inner with $* | Call to inner with "$@" | Call to inner with "$*"
| |
| |
| |
| |
Explain the following:
#!/bin/sh
file=$1
shift
vi `grep -l "$file" "$@"`
This one is the real doozy.. but here goes.
Given the following shell scripts
outer
--------------------------------------------------------------------------------
#!/bin/sh
echo $#
inner $*
inner "$@"
inner "$*"
--------------------------------------------------------------------------------
inner
--------------------------------------------------------------------------------
#!/bin/sh
echo $#
and the following command lines
--------------------------------------------------------------------------------
prompt> outer
prompt> outer 1 2 3
prompt> outer "1 2 3"
prompt> outer "A B" "C D"
prompt> outer "Hello Class, this is not too hard"
prompt> outer " "
--------------------------------------------------------------------------------
Fill in the following table
$# Call to inner with $* | Call to inner with "$@" | Call to inner with "$*"
| |
| |
| |
| |