2 Replies Latest reply on Jul 13, 2012 4:43 PM by EdStevens

    question regarding awk

      OL 5.6 64-bit

      given this:
      [root@vblnxsrv02 setup]# ls -1 /dev/sd[b-z]
      returns a list of devices I want to use as input for some other operations. So ...
      [root@vblnxsrv02 setup]# ls -1 /dev/sd[b-z] | awk '{FS="/"; print $3 }'
      [root@vblnxsrv02 setup]#
      Where I should get sdb, I get a blank line ... everything after is exactly what I want.

      When this part is working, I plan to expand it a bit to
      ls -1 /dev/sd[b-z] | awk '{FS="/"; print "some text " $3 " some more text" }' >> afile.lis
      I'm open to either tweaking the above or an entirely different approach.

      Edited by: EdStevens on Jul 13, 2012 10:56 AM