Shell: grep the true value -


when use grep value, gave me 2 value. how can true value?

for example:

vmdk

cid=abcdefgh

parentcid=12345678

shell

cid=$(grep -i "cid"  "snapshot.vmdk" | cut -d'=' -f2) echo "cid = $cid" 

result:

cid = abcdefgh

12345678

add -w flag in grep command like:

grep -w -i ... 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -