Need help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help
# 1  
Old 04-25-2011
Need help

Please help me to execute grep command to search for the pattern which begins with D or H.
# 2  
Old 04-25-2011
grep command pattern for lines that begin with D or H:
Code:
$ grep '^[DH]' inf_files >out_file

This User Gave Thanks to DGPickett For This Post:
# 3  
Old 04-25-2011
Code:
echo "DATA" | grep "^[DH]"

This User Gave Thanks to kevintse For This Post:
# 4  
Old 04-25-2011
Quote:
Originally Posted by kevintse
Code:
echo "DATA" | grep "^[DH]"

Thanks Smilie

---------- Post updated at 08:32 AM ---------- Previous update was at 08:31 AM ----------

Quote:
Originally Posted by kevintse
Code:
echo "DATA" | grep "^[DH]"

Quote:
Originally Posted by DGPickett
grep command pattern for lines that begin with D or H:
Code:
$ grep '^[DH]' inf_files >out_file

Thanks
# 5  
Old 04-25-2011
Code:
ruby -ne 'print if /^[DH]/' file

This User Gave Thanks to kurumi For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question