07-16-2012
Edit: Both work great, thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I'm new to sed, and need to add characters into a specific location of a file, the fileds are tab seperated.
text <tab> <tab> text <tab> text EOL
I need to add more characters to the line to look like this:
text <tab> <tab> newtext <tab> text <tab> text EOL
Any ideas? (2 Replies)
Discussion started by: tangentviper
2 Replies
2. Shell Programming and Scripting
please help in making sed singleline command
i need to insert dos new line (CR LF) before
" 34 matching device(s) found on \\cpu1."
" 6 matching device(s) found on \\cpu7."
" 102 matching device(s) found on \\mainserver."
the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies
3. Shell Programming and Scripting
I know that
sed -n '12p' file
will print line 12 but how might I insert text to a specified line?
thanks (2 Replies)
Discussion started by: action_owl
2 Replies
4. AIX
Hi,
I have to insert a line having variables using sed. But the variables are not getting substituted within sed.
Ex:
n=2
sed $n' i\
hi' file
This works. But the below code does not work.
n=2
line=hello
sed $n' i\
$line' file
The above code inserts '$line' in the 2nd line of the... (9 Replies)
Discussion started by: sugan
9 Replies
5. Shell Programming and Scripting
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Discussion started by: psve
18 Replies
6. UNIX for Advanced & Expert Users
Hi Guys,
can any one know how to replace the string by newline using sed ?
i dont need any other solution. I am very curious to know this in sed.
Input:
one,two,three
Output
one
two
three
we can acheive this by awk but in sed ?,
awk '{gsub(/\,/,"\n");print;}' File (6 Replies)
Discussion started by: rangarasan
6 Replies
7. Shell Programming and Scripting
Hi all,
I have a file called "text.cpp" with the first line of "1"
afterwards I tried in Ubuntu to type the following
sed '12iasdasdasdasdsad' test.cpp > output.txt
however when I tried to see the result of output.txt
#cat output.txt
1
why is the line 12 is not updated to the... (6 Replies)
Discussion started by: peuceul
6 Replies
8. Shell Programming and Scripting
Hello.
I have a config file (/etc/my_config_file) which may content :
#
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited
network_interface=eth0
# set this to the directory you want scanned.
# * if have multiple... (6 Replies)
Discussion started by: jcdole
6 Replies
9. Shell Programming and Scripting
hi
I am having a file like this
##############################
mod1 ( a(ll) , b(
c), try(o) , oll(ll)
go(oo) , al(ll)
mm(al) , lpo(kka)
kka(oop) );
mod2 ( jj(ll) , c(
kk), try1q(o1) , ofll(lll)
gao(oo1) , ala(llaa)
mmf(adl) , lddpo(kkad)
kkda(oodp) );... (20 Replies)
Discussion started by: kshitij
20 Replies
10. Solaris
Hi
I am trying to run a sed command within a script..unfortunately it wasn't written on Solaris so doesn't work. Can anyone help with the correct coding please?
It is:
sed -i '1i ROWID;ORDER_ID;JOB_NAME;ORDER_TABLE' ${OUTFILE} (4 Replies)
Discussion started by: Grueben
4 Replies
lta(4) Kernel Interfaces Manual lta(4)
Name
lta - lta pseudoterminal interface
Syntax
options LAT
pseudo-device lat
pseudo-device lta[n]
Description
The pseudoterminal interface provides support for local area transport (LAT) service. LAT service allows users to access remote nodes
through the Ethernet.
To configure the LAT service for your machine, you must:
o Edit the system configuration file.
o Edit the file.
o Create LAT special files.
o Edit the file.
Instructions for performing these tasks are further documented in the Guide to Ethernet Communications Servers.
Edit the Configuration File
Edit the configuration file to include the option and the and pseudo-devices. The configuration file to edit is located in
/sys/conf/vax/HOSTNAME or /sys/conf/mips/HOSTNAME (depending on your processor), where HOSTNAME is the name of your host processor, in
uppercase.
The optional value for the pseudo-device entry defines the number of LAT lines to configure, a number between 1 and 256. If you do not
specify a value, the default is 16 lines. For example, if you want to configure 32 LAT devices into your system, the entry for the LAT
lines is:
pseudo-device lta32
To use the system as a load host for remote note maintenance functions such as loading and controlling terminal servers, you must also
include an options entry for and a pseudo-device entry for in the configuration file.
Edit the /etc/rc.local File
Edit the file to restart LAT service automatically when the system reboots. Add the following entry after the commands for local daemon
startup:
if [ -f /etc/lcp ]; then
/etc/lcp -s > /dev/console & echo -n ' lat' >/dev/console
fi
Create LAT Special Files
Create the LAT special files by running the program from the directory and specifying the option. You create one LAT special file for each
LAT device. For example, the following commands create 32 device special files for LAT devices:
# cd /dev
# MAKEDEV lta0
# MAKEDEV lta1
The option range is 1 to 7. The maximum number of LAT special files is 256.
Edit the /etc/ttys File
Edit the file to include entries for all the LAT special files you created using the command. For more information on how to add these
entries, see
Files
Contains terminal devices defined to the machine.
Contains terminal devices defined to the machine (modem lines only).
See Also
ttys(5), MAKEDEV(8)
Guide to Ethernet Communications Servers
lta(4)