![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot store integer value | bennichan | Shell Programming and Scripting | 5 | 04-10-2008 11:20 AM |
| Grep results to store in a shell variable | jojan | Shell Programming and Scripting | 3 | 07-26-2007 09:44 AM |
| how can i store it ? | shamal | High Level Programming | 2 | 12-08-2001 02:19 AM |
| How to store username | dinplant | Shell Programming and Scripting | 3 | 11-13-2001 06:34 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
grep and store
When i grep a file and store it in a file it is storing as a zero byte file any way to avoid that.....
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Post your command. There is no way to give an accurate answer without that. Here is a thought though. Are you doing something like:
Code:
grep "something" arunkumar.txt > arunkumar.txt |
|
#3
|
|||
|
|||
|
Thank you but i want to do grep a same file and save in that file is that possible ?? please give some idea
|
|
#4
|
|||
|
|||
|
grep pattern filename >> filename
this would append the pattern search into the filename, is that you want? |
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
|||
|
|||
|
try this command
grep "expression" filename | & tee log This work for all command , one output will redirected to standard output which is screen and another in the file name log. rajesh |
|
#7
|
||||
|
||||
|
Two solutions ...
With sed (2 steps): Code:
sed -n '/expression/p' filename > tempfile mv tempfile filename Code:
perl -n -i -e 'print if /expression/' filename Jean-Pierre. |
||||
| Google The UNIX and Linux Forums |