Thanks Corona688 I tried to execute the script you posted but it does not give me an output. also i want to capture the output into a parameter, how do I do it.
It works absolutely fine here. Show exactly what you did, word for word, letter for letter, keystroke for keystroke, and I'll tell you why it didn't work. I suspect your input isn't quite what I expected.
To save something in a variable, save something in a variable. It's just a different statement in the same place, you can put whatever you want there.
case "$1" in
*NF)
VAR="NBC"
;;
SC*)
VAR="CBS"
;;
esac
Note there's no spaces on either side of the equal sign. Shell code insists on that, putting spaces there changes the meaning.