The UNIX and Linux Forums
Forum Home
Linux and Unix Man Pages
Search Forums
Search Community Posts
Today's Posts
Quick Links
Man Pages
RedHat Commands
OpenSolaris Commands
Linux Commands
SunOS Commands
FreeBSD Commands
All UNIX Man Pages
All Linux Man Pages
Full Man Repository
Login or Register to Ask a Question and Join Our Community
Search Forums
Show Threads .
Show Posts
Tag Search
Advanced Search
Quick Links
Contact Us
Forum Rules
Today's Posts
FAQ
Pictures & Albums
All Albums
Miscellaneous
What is My IP
Whois
Mark Forums Read
Shell Programming and Scripting
Need help
Tags
shell scripts
Login to Discuss or Reply to this Discussion in Our Community
Thread Tools
Search this Thread
Top Forums
Shell Programming and Scripting
Need help
#
1
04-25-2011
akshu.agni
Registered User
23,
0
Join Date: Mar 2011
Last Activity: 3 December 2015, 4:53 AM EST
Posts: 23
Thanks Given: 23
Thanked 0 Times in 0 Posts
Need help
Please help me to execute grep command to search for the pattern which begins with D or H.
akshu.agni
View Public Profile for akshu.agni
Find all posts by akshu.agni
#
2
04-25-2011
DGPickett
Registered User
4,673,
588
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks Given: 8
Thanked 588 Times in 561 Posts
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:
akshu.agni
DGPickett
View Public Profile for DGPickett
Find all posts by DGPickett
#
3
04-25-2011
kevintse
Registered User
248,
28
Join Date: May 2010
Last Activity: 24 May 2013, 10:11 PM EDT
Location: GuangZhou, China
Posts: 248
Thanks Given: 8
Thanked 28 Times in 27 Posts
Code
:
echo "DATA" | grep "^[DH]"
This User Gave Thanks to kevintse For This Post:
akshu.agni
kevintse
View Public Profile for kevintse
Find all posts by kevintse
#
4
04-25-2011
akshu.agni
Registered User
23,
0
Join Date: Mar 2011
Last Activity: 3 December 2015, 4:53 AM EST
Posts: 23
Thanks Given: 23
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
kevintse
Code
:
echo "DATA" | grep "^[DH]"
Thanks
---------- 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
akshu.agni
View Public Profile for akshu.agni
Find all posts by akshu.agni
#
5
04-25-2011
kurumi
Registered User
602,
83
Join Date: Dec 2009
Last Activity: 6 February 2016, 7:08 AM EST
Posts: 602
Thanks Given: 2
Thanked 83 Times in 78 Posts
Code
:
ruby -ne 'print if /^[DH]/' file
This User Gave Thanks to kurumi For This Post:
akshu.agni
kurumi
View Public Profile for kurumi
Find all posts by kurumi
Login or Register to Ask a Question
Previous Thread
|
Next Thread
Login or Register to Ask a Question
Member Badges and Information Modal
×