- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Regarding adding two lines at the end
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
тАО08-21-2006 02:47 AM
тАО08-21-2006 02:47 AM
Regarding adding two lines at the end
I have a file netmap.cfg ending with contents and a newline at the end of file as below
fep:\
:conn.retry.stwait=00.00.30:\
:conn.retry.stattempts=3:\
:conn.retry.ltwait=00.10.00:\
:conn.retry.ltattempts=6:\
:contact.name=:\
:contact.phone=:\
:descrip=:\
:sess.total=255:\
:sess.pnode.max=128:\
:sess.snode.max=127:\
:sess.default=1:\
:comm.info=fep;1364:\
:comm.transport=tcp:\
:comm.bufsize=4096:\
:pacing.send.delay=0:\
:pacing.send.count=0:
\n
I want to change the file contents as below with adding last two line tcp.max.time.to.wait and runstep.max.time.to.wait=300:
fep:\
:conn.retry.stwait=00.00.30:\
:conn.retry.stattempts=3:\
:conn.retry.ltwait=00.10.00:\
:conn.retry.ltattempts=6:\
:contact.name=:\
:contact.phone=:\
:descrip=:\
:sess.total=255:\
:sess.pnode.max=128:\
:sess.snode.max=127:\
:sess.default=1:\
:comm.info=fep;1364:\
:comm.transport=tcp:\
:comm.bufsize=4096:\
:pacing.send.delay=0:\
:pacing.send.count=0:
:tcp.max.time.to.wait=180:\
:runstep.max.time.to.wait=300:
\n
I have a file tempfile
>cat tempfile
:tcp.max.time.to.wait=180:\
:runstep.max.time.to.wait=300:
If i do a cat tempfile >> netmap.cfg
it's listing as below
fep:\
:conn.retry.stwait=00.00.30:\
:conn.retry.stattempts=3:\
:conn.retry.ltwait=00.10.00:\
:conn.retry.ltattempts=6:\
:contact.name=:\
:contact.phone=:\
:descrip=:\
:sess.total=255:\
:sess.pnode.max=128:\
:sess.snode.max=127:\
:sess.default=1:\
:comm.info=fep;1364:\
:comm.transport=tcp:\
:comm.bufsize=4096:\
:pacing.send.delay=0:\
:pacing.send.count=0:
:tcp.max.time.to.wait=180:\
:runstep.max.time.to.wait=300:
\n
How do i overcome this unnecessary newline? Is there anything i can try out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2006 02:55 AM
тАО08-21-2006 02:55 AM
Re: Regarding adding two lines at the end
From sed one-liners:
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' file > file1
cat tempfile >> file1
mv file1 netmap.cfg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2006 03:05 AM
тАО08-21-2006 03:05 AM
Re: Regarding adding two lines at the end
# grep -xv '' < netmap.cfg > netmap.cfg.new
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2006 08:16 PM
тАО08-21-2006 08:16 PM
Re: Regarding adding two lines at the end
this runs fine on my hp-ux 11i:
cat<>netmap.cfg
:tcp.max.time.to.wait=180:\
:runstep.max.time.to.wait=300:
!
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2006 08:18 PM
тАО08-21-2006 08:18 PM
Re: Regarding adding two lines at the end
couple of solutions here.
Can you please update the thread.
If the answers are not right, please let us know.