11-23-2004
Replace Text with sed
Hi ,
I´m working on Solaris 9 SPARC and I´m writing a Script to mírror two disks..
I need to replace some text in a file ( /etc/vfstab ) .
For example:
/dev/dsk/c0t0d0s0 ==> /dev/md/dsk/d0
I just want to change the "/dev/dsk/" to "/dev/md/dsk/.
Thanks for your repsonse
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to replace text in a file with text from a variable
I have the following in my script, but its not working:
#!/bin/ksh
echo "Enter the path to load scripts"
read x
echo "updating the templates"
sed "s/CHANGE_ME_TO_LOAD_PATH/"$x"/g" LoadFiles.sh > LoadFiles2.sh
I thought... (1 Reply)
Discussion started by: orahi001
1 Replies
2. Shell Programming and Scripting
Howdy!
I'm trying to automate editing of a configuration file (custom.conf for GDM). I need to find every line between a line that starts with "" and the next line that starts with "", I want to preserve that line, but then delete all the lines in that configuration section and then insert... (3 Replies)
Discussion started by: TXTad
3 Replies
3. Shell Programming and Scripting
Hi,
My input file
form 1
fill 2
fill 3
form 4
fill 5
form 6
fill 7
form 8
Now i need to substiute according to the fill.
form followed by single fill need to be replced with category 1
form with above and below fill need to be repalced with category 2 (5 Replies)
Discussion started by: vasanth.vadalur
5 Replies
4. Shell Programming and Scripting
Hi,
I need to replace text in a file. Can someone help me write the proper sed command for this? My text file contains about a 100 lines of content. I want to replace the line containing
new_name = "#{options}-#{ENV}"
by, the following -
new_name = "#{options}-#{ENV}-#{rand(999)}"
... (1 Reply)
Discussion started by: ankush2kn
1 Replies
5. Shell Programming and Scripting
Hi,
I hope someone can help me out with the following:
I have a file with the following lines in it:
something /path/dir/my_-_file.01.ext sometext sometext
somethingelse /path/dir/my_-_file.02.ext sometext
something /path/dir/my_-_file.03.ext sometext some other text
And i want to... (3 Replies)
Discussion started by: thyssimonis
3 Replies
6. Shell Programming and Scripting
can anyone please help me in the below scenario:
File1:
Hello1
Hello1
i want to use sed to replace multiple occurances of Hello1 in file 1 to welcome.
Thanks a ton for the help (9 Replies)
Discussion started by: amithkhandakar
9 Replies
7. Shell Programming and Scripting
Hi,
i want to replace
"Hi How
are You when
did you go to
delhi"
to
"Hi How
are you when
did you come from
delhi"
in a file.
Any idea how to do it? (2 Replies)
Discussion started by: abhitanshu
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I want to use sed to replace " /// " with "///" in a text file. However I am getting error messages when I use sed 's/ /// /////g' input.txt > output.txt. How do I go about doing this in sed?
Input:
219518_s_at 0.000189 ELL3 / SERINC4
Output:
219518_s_at 0.000189 ELL3/SERINC4 (5 Replies)
Discussion started by: evelibertine
5 Replies
9. Shell Programming and Scripting
I have a sample text format as given below
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456" From="1626711840902323"... (3 Replies)
Discussion started by: my_Perl
3 Replies
10. Debian
Good Day Every one
I have a problem finding and replacing text in some large files that will take a long time to manually edit.
Example text file looks like this
#Example Large Text File
unix
linux
dos
squid
bind
dance
bike
car
plane
What im trying to do is to edit all the... (4 Replies)
Discussion started by: linuxjunkie
4 Replies
LEARN ABOUT OPENSOLARIS
sdcard
sdcard(7D) Devices sdcard(7D)
NAME
sdcard - SD/MMC memory card driver
DESCRIPTION
The sdcard memory card driver supports MultiMediaCard (MMC), Secure Digital (SD), and Secure Digital High Capacity (SDHC) memory cards. It
uses the blk2scsa(7D) service to present these cards to the system as SCSI disks on a virtual SCSI bus, creating a child device to be ser-
viced with sd(7D). Each card appears as its own SCSI LUN. Cards are hot-pluggable and removable.
DEVICE SPECIAL FILES
Disk block special file names are located in /dev/dsk. Raw file names are located in /dev/rdsk. See sd(7D).
IOCTLS
See dkio(7I)
ERRORS
See sd(7D) and blk2scsa(7D). Additionally, sdcard may issue the following warnings, which indicate a failure to identify the card as a sup-
ported type:
"Unknown SD CSD version (%d)"
"Unknown MMC CSD version (%d)"
"Unknown MMCA version (%d)"
"Card type unknown"
FILES
Device special files for the storage device are created in the same way as those for a SCSI disk. See sd(7D) for more information.
/dev/dsk/cntndnsn Block files for disks.
/dev/rdsk/cntndnsn Raw files for disks.
/kernel/drv/sdcard 32-bit ELF kernel module (x86).
/kernel/misc/amd64/sdcard 64-bit ELF kernel module (x86).
/kernel/drv/sparcv9/sdcard 64-bit ELF kernel module (SPARC).
ATTRIBUTES
See attributes(5) for a description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Architecture |SPARC, x86 |
+-----------------------------+-----------------------------+
|Availability |SUNWsdcard |
+-----------------------------+-----------------------------+
SEE ALSO
rmformat(1), rmmount(1), cfgadm_scsi(1M), cfgadm_sdcard(1M), fdisk(1M), mount(1M), umount(1M), scsi(4), vfstab(4), attributes(5),
blk2scsa(7D), sd(7D), sda(7D), dkio(7I), pcfs(7FS)
System Administration Guide, Volume I
System Administration Guide: Basic Administration
DIAGNOSTICS
See sd(7D).
SunOS 5.11 28 Feb 2008 sdcard(7D)