![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | 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 !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Hi I am writing a shell script for a number of things and aone problem that keeps comming up is AWK formatting. When commands are typed into the command line they are fine, but when executed in the script the results are pilled up and not in a list/table format. I have tried using awk'/$input/{print $1,$2,$...etc.... But it doesn't work, nothing happens, the code may aswell be invisible. anyway here is the code I have written. Code:
echo "Type in user: " read input echo "The last login of $input was: " `last $input | tail -10 | NEED CODE HERE FOR FORMATTING` the result that comes out atm is: Code:
The last login of jsk1gcc was: jsk1gcc pts/17 192.168.***.** Tue Nov 17 09:35 - 12:13 (02:37) jsk1gcc pts/12 192.168.***.** Tue Nov 10 10:28 - 10:30 (00:02) jsk1gcc pts/14 192.168.***.** how to I get it to do list like this this instead: Code:
The last login of jsk1gcc was: jsk1gcc pts/17 192.168.***.** Tue Nov 17 09:35 - 12:13 (02:37) jsk1gcc pts/12 192.168.***.** Tue Nov 10 10:28 - 10:30 (00:02) jsk1gcc pts/14 192.168.***.** Tue Nov 10 10:22 - 12:14 (01:51) Jade. |
|
|||
|
Quote the output of the command: Code:
echo "The last login of $input was: " "`last $input | tail -10 | NEED CODE HERE FOR FORMATTING`" or just: Code:
echo "The last login of $input was: " last $input | tail -10 |
|
|||
|
I can't believe it was that simple. Thankyou
When you've been working on one problem for more that 8 hours you forget the the simple things. again thankyou. Feel like a dunce now =} Jade. ![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems with NTP | veccinho | SCO | 1 | 01-16-2008 05:19 PM |
| DNS problems. | Westy564 | UNIX for Dummies Questions & Answers | 5 | 02-17-2004 12:07 AM |
| CD-ROM Problems | saucierm | UNIX for Dummies Questions & Answers | 5 | 10-23-2003 03:20 PM |
| 'make' problems (compliation problems?) | xyyz | UNIX for Advanced & Expert Users | 5 | 11-05-2001 10:47 PM |