![]() |
|
|
|
|
|||||||
| 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 |
| get sysname with getline in awk | timj123 | Shell Programming and Scripting | 2 | 02-24-2008 07:43 PM |
| NAWK getline function | Raynon | Shell Programming and Scripting | 5 | 11-28-2007 12:30 AM |
| awk getline help maybe? | chlawren | Shell Programming and Scripting | 0 | 10-24-2007 07:56 AM |
| utility of getline here? | remid1985 | UNIX for Dummies Questions & Answers | 3 | 11-12-2006 10:38 AM |
| getline with a unique | gozer13 | Shell Programming and Scripting | 6 | 03-03-2005 09:20 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
awk:Problem with getline
Code:
$ echo |awk ' BEGIN {"date" | getline current_time;close("date");print "Report printed on " current_time}'
Report printed on Thu May 11 14:57:29 METDST 2006
Thx in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
|
|
#3
|
||||
|
||||
|
Of course , i want to execute a system function (output longer than 1 line) and capture all the results.
This "bad" ex shows 1 line only: Code:
$ awk ' BEGIN {"who" | getline USERS;close("who");print USERS}'
jefe pts/1 May 12 07:04
Thanks. |
|
#4
|
||||
|
||||
|
Ok , issue solved !
This piece did the job: Code:
awk ' BEGIN { while (("who" | getline) > 0){print};close("who")}'
|
||||
| Google The UNIX and Linux Forums |