HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- About line editing
Operating System - HP-UX
1834163
Members
2482
Online
110064
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
10-08-2003 01:25 AM
10-08-2003 01:25 AM
For script purpuse, how can I take a line number and to work with exact line?
Is there simple command which works with lines of the file?
For example I want to take line 3 from file1 and to put it between 6 and 7 of file2?
Is there simple command which works with lines of the file?
For example I want to take line 3 from file1 and to put it between 6 and 7 of file2?
Text editor
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2003 01:28 AM
10-08-2003 01:28 AM
Re: About line editing
There are no commands to do what you want here. I would suggest a script to do it.
Never preceed any demonstration with anything more predictive than "watch this"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2003 01:48 AM
10-08-2003 01:48 AM
Re: About line editing
To get line 3 from file 1
--
awk '(NF==3){print}' file1
--
to get line 3 from file 1 and save it in an environment variable:
--
L3=$(awk '(NR==3){print}' file1)
--
To put this before line 7 of file2 and send the result to fil33
--
awk -v L=$L3 '(NR==7) {print L} {print}' file2 > file3
--
You get the idea.
-- Graham
--
awk '(NF==3){print}' file1
--
to get line 3 from file 1 and save it in an environment variable:
--
L3=$(awk '(NR==3){print}' file1)
--
To put this before line 7 of file2 and send the result to fil33
--
awk -v L=$L3 '(NR==7) {print L} {print}' file2 > file3
--
You get the idea.
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2003 02:01 AM
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP