0

I was trying to write a kshell script for displaying the output and searching something in the output and then displaying only that output.

I tried doing the following:

cv = print "blah blah kir kanj" 
read CV
print "$cv"

I think this would work. But what if I get output in form of table:

date         id         name    release
123           1          er       ererere  
12            2          pr       irjj

So now If I want to search for name = pr?

how can I do that using same concept?

Tried same concept but it doesn't work

Eduardo Briguenti Vieira
  • 4,351
  • 3
  • 37
  • 49
kyle
  • 103
  • 1
  • 8
  • sorry, but this is painful to read. ksh using `cv = print "blah .."` ? Sorry, that won't work. Maybe `cv="blah ..."` OR if you really need `print` for some reason, then `cv=$(print "blah ...")`. ... Then `read CV` ? where do you use the variable `CV`, recall that unix and shells are case sensitive. Do you know about the `grep` command? try `man grep` or search here for examples of how it is used. Finally, you can use shell `case $name in *pr* ) echo "matched pr in var name ; * ) echo "no match for pr in var name" ;; esac` . Good luck. – shellter Sep 09 '14 at 19:02
  • Sorry for not being clear. But thanks I got it now :D – kyle Sep 09 '14 at 19:28

0 Answers0