- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- awk help and shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2003 06:28 PM
тАО12-10-2003 06:28 PM
awk help and shell script
I wish to remove some of the column.
QAS Completed trans 12/11/03 05:00:06 1071090006 12/11/03 05:04:07 1071090247 0:00 0:04 0.37 1 0 3 0 0 0 4 4 4 100% root.sys@cm.esc 2003/12/11-14
In my shell script
cat $DESTDIR/ses.final | while read LINE
do
LINE2=`echo $LINE | awk '{print $1 $2 $3}'`
done
Is it possible to put \t (tab) in between $1 $2 & $3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2003 06:35 PM
тАО12-10-2003 06:35 PM
Re: awk help and shell script
You just need to use printf instead of print :
LINE2=`echo $LINE | awk '{printf "%s\t%s\t%s\n", $1, $2, $3}'`
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2003 06:40 PM
тАО12-10-2003 06:40 PM
Re: awk help and shell script
Try
LINE2=`echo $LINE | awk '{print $1,"\011",$2,"\011",$3}'`
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2003 06:47 PM
тАО12-10-2003 06:47 PM
Re: awk help and shell script
you can use the \t suggested by Jean with the print command also.
LINE2=`echo $LINE | awk '{print $1,"\t",$2,"\t",$3}'`
hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2003 07:31 PM
тАО12-10-2003 07:31 PM
Re: awk help and shell script
awk '
{printf ("%s\t%s\t%s\n", $1, $2, $3)}
' $DESTDIR/ses.final
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 02:13 AM
тАО12-11-2003 02:13 AM
Re: awk help and shell script
cat $DESTDIR/ses.final |
while read var1 var2 var3
do
print "$var1\t$var2\t$var3"
done