| | |
grep '^[a-zA-Z]'
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
I assume this is coming after some other command, right? Such as
So, what the following pipeline command does
is return all lines that start with a letter, whether capital or not. Effectivly filtering out all lines that do not.
That is, as long as it is double quotes (
cat somefile.So, what the following pipeline command does
Shell Scripting Syntax (Toggle Plain Text)
cat somefile | grep "^[a-zA-Z]"
That is, as long as it is double quotes (
") that are used. I believe that if it is single quotes (') are used, that it will only return those lines that contain (anywhere in the line) exactly those characters. I do not have a *nix system at hand, currently, to check that again though, and it has been a while since I have been able to work extensivly on an *nix system. Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- 'GREP' usage on huge files, any Limitation? (Shell Scripting)
- Program for Grep search (Pascal and Delphi)
- Using Grep (*nix Software)
- derive full name of user and grep search count (Shell Scripting)
- help writing a grep program (C)
Other Threads in the Shell Scripting Forum
- Previous Thread: rm command
- Next Thread: read line is stripping leading spaces
| Thread Tools | Search this Thread |






