Sponsored Content
Top Forums Shell Programming and Scripting Appending line with sed works on Linux but not on Solaris Post 80654 by aigles on Wednesday 10th of August 2005 11:25:22 AM
Old 08-10-2005
The problem is the same for AIX
You must have a new line after the \
Code:
sed '2a\
Add this line after line 2' foo.txt

or

sed '2a\^JAdd this line after line 2' foo.txt

^J is inserted with ^V+^J
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending line/lines with sed

Hi folks, I need to append line or bulk of lines into a file. For example,I have the following section in opmn.xml file: <process-type id="OC4J_RTEadmin_NIR" module-id="OC4J"> <module-data> <category id="start-parameters"> <data... (28 Replies)
Discussion started by: nir_s
28 Replies

2. Shell Programming and Scripting

Sed - Appending a line with a variable on it

Hi, I searched the forum for this but couldn't find the answer. Basically I have a line of code I want to insert into a file using sed. The line of code is basically something like "address=1.1.1.1" where 1.1.1.1 is an IP Address that will vary depending on what the user enters. I'll just refer... (4 Replies)
Discussion started by: eltinator
4 Replies

3. Shell Programming and Scripting

Script works on Solaris, not on Linux

I'm in the same boat as Barbus - same exercis (https://www.unix.com/shell-programming-scripting/43609-processes-users.html) The following script works on a solaris server I have access to. It doesn't however, work on the companies Linux machine. Any idea what's up? I have very little shell... (0 Replies)
Discussion started by: Silverhood
0 Replies

4. Shell Programming and Scripting

Script works on Solaris, not on Linux

I'm in the same boat as Barbus - same exercis (https://www.unix.com/shell-programming-scripting/43609-processes-users.html) The following script works on a solaris server I have access to. It doesn't however, work on the companies Linux machine. Any idea what's up? I have very little shell... (1 Reply)
Discussion started by: Silverhood
1 Replies

5. Shell Programming and Scripting

sed: appending alternate line after previous line

Hi all, I have to append every alternate line after its previous line. For example if my file has following contents line 1: unix is an OS line 2: it is open source line 3: it supports shell programming line 4: we can write shell scripts Required output should be line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
4 Replies

6. Shell Programming and Scripting

awk;sed appending line to previous line....

I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one: User1NameLast User1NameFirst User1Address E-Mail:User1email User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies

7. Shell Programming and Scripting

Delete rest of line with sed works on Linux but not on Solaris

Hi all, Our application installation uses "sed" command to delete rest of line. It work perfect on Linux but fail on Solaris. The OS versions are Solaris 9 and Linux Red Hat AS 3. yourfile.txt hello and world cat and dog hello world in linux: cat yourfile.txt | sed ‘s/\(\+\)... (3 Replies)
Discussion started by: javac2005
3 Replies

8. Shell Programming and Scripting

sed works on Linux and Unix does not work

Hi, I use this command in Linux but if I run the same command does not work in freebsd. Follow the below command: Linux works: sed -e '1731a\' -e '####' squid.conf > squid2.conf ; sed -e '1731a\' -e 'acl TESTE_ip src 192.168.1.1/255.255.255.255' squid2.conf > squid.conf ; sed -e... (7 Replies)
Discussion started by: andreirp
7 Replies

9. Shell Programming and Scripting

Script works with Linux not with Solaris

Hi I have the following script which works in Linux shell but gives issues with Sun OS Solaris 5.10, What i am trying to achieve here is we have a list of file names in list.txt file and we parse each file at a time for a particular pattern and copt next 4 lines after we hit the pattern to a... (6 Replies)
Discussion started by: Yugendra
6 Replies

10. Shell Programming and Scripting

sed works on Linux but fails on Solaris

Hi, On Linux i get the desired ouput: echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output: Executing the same command on Solaris: echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output: I need to get the desired output on Solaris i.e. WEB_USER and... (4 Replies)
Discussion started by: mohtashims
4 Replies
SHTOOL-INSTALL.TMP(1)					      GNU Portable Shell Tool					     SHTOOL-INSTALL.TMP(1)

NAME
shtool-install - GNU shtool install(1) command SYNOPSIS
shtool install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode mode] [-o|--owner owner] [-g|--group group] [-e|--exec sed-cmd] file [file ...] path DESCRIPTION
This command installs a one or more files to a given target path providing all important options of the BSD install(1) command. The trick is that the functionality is provided in a portable way. OPTIONS
The following command line options are available. -v, --verbose Display some processing information. -t, --trace Enable the output of the essential shell commands which are executed. -d, --mkdir To maximize BSD compatiblity, the BSD "shtool "install -d"" usage is internally mapped to the "shtool "mkdir -f -p -m 755"" command. -c, --copy Copy the file to the target path. Default is to move. -C, --compare-copy Same as -c except if the destination file already exists and is identical to the source file, no installation is done and the target remains untouched. -s, --strip This option strips program executables during the installation, see strip(1). Default is to install verbatim. -m, --mode mode The file mode applied to the target, see chmod(1). Setting mode to ""-"" skips this step and leaves the operating system default which is usually based on umask(1). Some file modes require superuser privileges to be set. Default is 0755. -o, --owner owner The file owner name or id applied to the target, see chown(1). This option requires superuser privileges to execute. Default is to skip this step and leave the operating system default which is usually based on the executing uid or the parent setuid directory. -g, --group group The file group name or id applied to the target, see chgrp(1). This option requires superuser privileges to execute to the fullest extend, otherwise the choice of group is limited on most operating systems. Default is to skip this step and leave the operating system default which is usually based on the executing gid or the parent setgid directory. -e, --exec sed-cmd This option can be used one or multiple times to apply one or more sed(1) commands to the file contents during installation. EXAMPLE
# Makefile install: : shtool install -c -s -m 4755 foo $(bindir)/ shtool install -c -m 644 foo.man $(mandir)/man1/foo.1 shtool install -c -m 644 -e "s/@p@/$prefix/g" foo.conf $(etcdir)/ HISTORY
The GNU shtool install command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1997 for GNU shtool. It was prompted by portability issues in the installation procedures of OSSP libraries. SEE ALSO
shtool(1), umask(1), chmod(1), chown(1), chgrp(1), strip(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-INSTALL.TMP(1)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy