Pranesh
asked on
Bash script
Good day Group
I am just a beginner with bash scripting and I just need some direction in creating a script. So basically, I need to create a script where if
I execute with the script like this :
./script bob - it prints out Mary
and
./script Mary - it prints out bob
and if neither command is parsed to it, it returns to stand err
Any suggestions would be highly appreciated.
I am just a beginner with bash scripting and I just need some direction in creating a script. So basically, I need to create a script where if
I execute with the script like this :
./script bob - it prints out Mary
and
./script Mary - it prints out bob
and if neither command is parsed to it, it returns to stand err
Any suggestions would be highly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
unless other wise provided for 2>&1 and >&2 are exactly the same. typicall stderr is redirected to a file for debugging. stderr defaults to stdout unless outerwise directed. since tuxracer did not specify a file both 2>&1 and >&2 are exactly the same.
ASKER
Hi Guys
Thank you all for the great responses. Its what I was looking for for.
Much appreciated!!!! Collaboration - rocks!!!
Tuxracer
Thank you all for the great responses. Its what I was looking for for.
Much appreciated!!!! Collaboration - rocks!!!
Tuxracer
Welcome
*)
echo wrong name
to:
*)
echo "wrong name" >&2
That will write "wrong name" to standard error..