- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- About the script writing
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
тАО11-12-2003 02:07 PM
тАО11-12-2003 02:07 PM
About the script writing
#vi system1.txt
01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 02:34 PM
тАО11-12-2003 02:34 PM
Re: About the script writing
awk 'END {
printf( "%s, %s, %s, %s\n", PrevOne, PrevTwo, LastOne, LastTwo );
}
{
PrevOne = LastOne;
PrevTwo = LastTwo;
LastOne = $(NF - 1);
LastTwo = $(NF);
}' < system1.txt
Not the most neat/elegant, but it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 04:38 PM
тАО11-12-2003 04:38 PM
Re: About the script writing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 04:58 PM
тАО11-12-2003 04:58 PM
Re: About the script writing
tail --lines=2 system1.txt | cut -f9-10
would be close, but not in the format listed above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 05:31 PM
тАО11-12-2003 05:31 PM
Re: About the script writing
had been trying my hand at it when you can out with it...
J-P (0 point for this just a comment, thanks.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 05:40 PM
тАО11-12-2003 05:40 PM
Re: About the script writing
tail -2 system1.txt | cut -d " " -f 9-10
works for me though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 05:52 PM
тАО11-12-2003 05:52 PM
Re: About the script writing
how can i cut this characters "49,50,59,60" from the file "a.txt" and then paste it to another file "b.txt" in a specific position ? thx
$vi b.txt
<----------blank---------->
<--blank->49 50<--blank--->
<--blank->59 60<--blank--->
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 06:16 PM
тАО11-12-2003 06:16 PM
Re: About the script writing
I think we are now moving away from the realm of one liners :)
Could you be a bit more specific about where in the second file you want the number to appear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 06:21 PM
тАО11-12-2003 06:21 PM
Re: About the script writing
I just want the characters paste to the third column ( leave the first two column blank ) , how to do it ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 06:28 PM
тАО11-12-2003 06:28 PM
Re: About the script writing
tail -2 a.txt | cut -d " " -f 9-10 | {
echo
while read a
do
echo " $a"
done
echo
} > b.txt