Substitute from awk results

Hi,
The following awk command :

asmcmd lsdg | awk '{print $13;}' | grep -i ${SID}

return the following output . An Empty line + two lines contain "/" at the end of the line

INDEVDATA/
INDEVFRA/

I need to remove the "/" as well as the empty line.
Please advise

Thanks

add to your code

sed -e 's/\///g' -e '/^$/d'

You could do the whole thing in an awk program:

asmcmd lsdg | awk -v S="$SID" 'BEGIN{IGNORECASE=1}$13~S&&NF{gsub("/",x,$13);print $13}'

Use nawk instead in SunOS or Solaris

1 Like

I wonder how grep -i ${SID} can deliver an empty line.
What is ${SID} ?