Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

echo not working with grep

 
rahulJ james
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have the 2 lines in a simple script. I dont get the echo working

abcd=`grep -n "^GS.*123456.*" /tmp/fileName | cut -d: -f1`
echo $abcd

I get the results when I run the same in the command prompt though not as a script.. Any advise
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Looks like the same question as this one
 
    Bookmark Topic Watch Topic
  • New Topic