|
|
Subject: SUMMARY: sed script help4 - msg#00079
List: os.solaris.managers.summaries
Thank you very much for the overwhelming response.
For my purposes, putting a $ sign after the 1
instructs the replace command to stop after the 1,
just as the ^ instructs it to start at smDisabled.
> /bin/sed 's/^smDisabled: 1/smDisabled: disabled/' <
> $TEMP3 > $DATA_MMM
--- pelicancomputers <rfransix@xxxxxxxxx> wrote:
> i have a one liner like this:
>
> /bin/sed 's/^smDisabled: 1/smDisabled: disabled/' <
> $TEMP3 > $DATA_MMM
>
> however, it replaces not only '1', but anything else
> that begins with a '1'.
>
> how can i write this to only replace this
> attribute's value if it is a '1'?
>
> thank you.
>
> rick
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
SUMMARY Re: new disk on 420R
doh!
as some people pointed out, I should have been running newfs
on the raw disk device, rather than the block device.
the problem was I was missing a '0' after c0t1
the path should have been c0t10d0s0
and now everything is hunky-dory
Steve
On Thu, 14 Nov 2002, Steve Elliott wrote:
> I'm stuck.
> Got a 36GB new disk drive, slotted it into the system.
> touch /reconfigure and reboot
> format sees the disk, I can partition and label the disk,
> but when I try newfs:
> # newfs /dev/dsk/c0t1d0s1
> newfs: /dev/dsk/c0t1d0s1: No such file or directory
> #
>
>
>
> what have I missed?
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@xxxxxxxxxxxxxxx
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Next Message by Date:
click to view message preview
SUMMARY: Listing open files in a filesystem without 'lsof'.
Hi,
Thank you to everyone who responded to my problem and the winner is
Osama Ahmed, your solution worked.
He suggested using 'lockfs -h /mount-point', then 'umount /mount-point'.
Lockfs changes or reports on file system locks, the -h option puts a
hard-lock on the file system and would report
an error on every access and it cannot be unlocked, but can be umount'd.
I did find however that I needed to run 'fsck', over the disk as I
believe the above option was like a power cut to the disk.
Other suggestions throughout the course of this query were to use
'fuser', with the '-k, -c, and -u' options.
Also, using '/usr/proc/bin/pfiles <pid>', which is run on the /proc
directory and displays the files open to each process.
Thank you all again for your suggestions.
Craig.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Craig Burtenshaw
Unix Systems/Oracle Database Administrator
Information Services
Australian Maritime Safety Authority
PO Box 2181
Canberra City ACT 2601
Lvl 2, 25 Constitution Ave
Canberra City ACT 2601
Ph: 61+ (0) 2 6279 5824
Fax: 61+ (0) 2 6279 5024
E-Mail: mailto:Craig.Burtenshaw@xxxxxxxxxxx
AMSA Web site: http://www.amsa.gov.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Friends help you move. Real friends help you move bodies.
that any use or dissemination of this communication is prohibited.
If you receive this transmission in error, please notify us immediately
by telephone on 02-62795000 and delete all copies of this transmission
together with any attachments.
**********************************************************************
Previous Message by Thread:
click to view message preview
SUMMARY Re: new disk on 420R
doh!
as some people pointed out, I should have been running newfs
on the raw disk device, rather than the block device.
the problem was I was missing a '0' after c0t1
the path should have been c0t10d0s0
and now everything is hunky-dory
Steve
On Thu, 14 Nov 2002, Steve Elliott wrote:
> I'm stuck.
> Got a 36GB new disk drive, slotted it into the system.
> touch /reconfigure and reboot
> format sees the disk, I can partition and label the disk,
> but when I try newfs:
> # newfs /dev/dsk/c0t1d0s1
> newfs: /dev/dsk/c0t1d0s1: No such file or directory
> #
>
>
>
> what have I missed?
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@xxxxxxxxxxxxxxx
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Next Message by Thread:
click to view message preview
SUMMARY: Listing open files in a filesystem without 'lsof'.
Hi,
Thank you to everyone who responded to my problem and the winner is
Osama Ahmed, your solution worked.
He suggested using 'lockfs -h /mount-point', then 'umount /mount-point'.
Lockfs changes or reports on file system locks, the -h option puts a
hard-lock on the file system and would report
an error on every access and it cannot be unlocked, but can be umount'd.
I did find however that I needed to run 'fsck', over the disk as I
believe the above option was like a power cut to the disk.
Other suggestions throughout the course of this query were to use
'fuser', with the '-k, -c, and -u' options.
Also, using '/usr/proc/bin/pfiles <pid>', which is run on the /proc
directory and displays the files open to each process.
Thank you all again for your suggestions.
Craig.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Craig Burtenshaw
Unix Systems/Oracle Database Administrator
Information Services
Australian Maritime Safety Authority
PO Box 2181
Canberra City ACT 2601
Lvl 2, 25 Constitution Ave
Canberra City ACT 2601
Ph: 61+ (0) 2 6279 5824
Fax: 61+ (0) 2 6279 5024
E-Mail: mailto:Craig.Burtenshaw@xxxxxxxxxxx
AMSA Web site: http://www.amsa.gov.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Friends help you move. Real friends help you move bodies.
that any use or dissemination of this communication is prohibited.
If you receive this transmission in error, please notify us immediately
by telephone on 02-62795000 and delete all copies of this transmission
together with any attachments.
**********************************************************************
|
|