Operating System - HP-UX
1834366 Members
2028 Online
110066 Solutions
New Discussion

Shell script to remove bootptab entry

 
SOLVED
Go to solution
justahuman
Advisor

Shell script to remove bootptab entry

Hi,
i need to remove a single entry in /etc/bootptab. This should be done by a shell script.
Is there someone who can supply me with this script ?
I think that this is quit simple, but i just start with shell programming, so i need help.
Thank in advance
Michael
Hier arbeitet die Firma Rast und Ruh; Vormittags geschlossen und Nachmittags ist zu !
3 REPLIES 3
Ashish Tripathi
Advisor

Re: Shell script to remove bootptab entry

Hi,
If the entry to be removed is static then just remove the entry and copy /etc/bootptab to some /etc/bootptab.new and a small script like
/usr/bin/cp -p /etc/bootptab.new /etc/bootptab
should solve u'r purpose.
But is entry is variable then u can use "sed"
Hope it helps.
Ashish
The best way to make dreams true is to wake up.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Shell script to remove bootptab entry

Here you go Micheal:

The attached script is adapted from the 'rmbootpentry' script supplied with the JetAdmin software.

Use it like this:
rmbootpentry /etc/bootptab xterm1

where the first arg is the name of the bootptab
and the second arg is the short name of the entry you wish to remove.

This should do just what you want, Clay.
If it ain't broke, I can fix that.
Vincenzo Restuccia
Honored Contributor

Re: Shell script to remove bootptab entry

#cp -p /etc/bootptab /etc/bootptab.out
#sed 's/your_entry//g' /etc/bootptab.out > /etc/bootptab