![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| redirect cat to variable | shailesh_arya | Shell Programming and Scripting | 7 | 07-10-2008 05:34 AM |
| after grep i want to redirect it to some variable | mail2sant | Shell Programming and Scripting | 2 | 04-07-2008 10:26 AM |
| Redirect to variable | MrAd | UNIX for Dummies Questions & Answers | 2 | 05-07-2007 05:18 PM |
| Redirect Output In Variable | ZINGARO | UNIX for Dummies Questions & Answers | 1 | 08-02-2006 07:56 AM |
| please help: how to redirect input into a variable | artur80 | Shell Programming and Scripting | 2 | 11-17-2002 10:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Redirect to a Variable? Or is it cmd cap?
Hi,
Im reading an ANSI text file and greping for a pattern. Then i cut what i dont need from that pattern. So now i just have what i need. What i have now just so happens to be a constant integer. How can i save this integer in a varaible? Or do i use command capture in some form? Code:
cat Hello.txt | egrep "That One Pattern" | awk '{print $NF}'
Since maybe i can use these varaibles with the one i would like to store above.. Code:
awk '{for (i=1; i<=NF; i++) s=s+$i}; END{print s}'
|
|
||||
|
Code:
cat Hello.txt | egrep "That One Pattern" | awk '{print $NF}'
So i used another method: Code:
cat Hello.txt | egrep "That One Pattern" | cut -d':' -f2 Code:
Value=Hello.txt | egrep "That one Pattern" | cut -d':' -f2 ----------------------------------------------- Everybody looks cool at blacklight parties execpt for me, because i was under the impretion that the mustard stain came out... ------------------------------------------------ |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|