Sponsored Content
Full Discussion: replace at specifcposition
Top Forums Shell Programming and Scripting replace at specifcposition Post 302141049 by jim mcnamara on Wednesday 17th of October 2007 12:30:51 PM
Old 10-17-2007
try the i command in sed
Code:
sed '/^xxx_hij/i\
<write a text line here>' filename

input
Code:
#xxxxx abced
xxx_hij=

output
Code:
#xxxxx abced
<write a text line here>
xxx_hij=

 

10 More Discussions You Might Find Interesting

1. Linux

what to replace XP with?

Hey i've got a laptop that is my main computer right now and i wanted to put something *nix on it. However i do need something that will run some of my windows apps... mostly my games haha. I don't want to have to run a third party app like wine. Which distros would be right for me? (2 Replies)
Discussion started by: byblyk
2 Replies

2. Shell Programming and Scripting

Replace \n with \r\n

Hi Dudes, I want to replace \n with \r\n through out the file. For this I opened vi editor there tried with " s/\\n/\\r\\n/g ", with this I must be able to satisfy my requirements. But it is searching for the current line (Where cursor is). I need this for entire file. No problem if it is... (3 Replies)
Discussion started by: Chanakya.m
3 Replies

3. Shell Programming and Scripting

replace last / by |

Hi: I want to write a Kshell script which will replace last / by |. eg: /home/apps/test/document should be replaced as /home/apps/test|document. The length of the string is not constant. Thanks, Ash (6 Replies)
Discussion started by: naikaa
6 Replies

4. UNIX for Dummies Questions & Answers

Replace in VI

Hi All, How to add a '*' at the begining of VI file between lines in a range say 20 -30?? Please help. I tried :%s/20,30/^/\*/ Did not work. Thanks and Regards, Gideon. (3 Replies)
Discussion started by: preethgideon
3 Replies

5. Shell Programming and Scripting

replace \r\r\n with \r\n

I am having a dificult time trying to replace 2 carriage returns and 1 newline with 1 carriage return and 1 newline in a file. The file may come as CR NL in which case I need to leave it as is. When it comes with CR CR NL then I need to remove one of the CR's. i tried sed 's/\r\r\n/\r\n\g'... (6 Replies)
Discussion started by: hanton
6 Replies

6. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

7. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

8. Shell Programming and Scripting

Replace help

Hi experts, I have a csv file where the delimiter is comma and the text between apostrophe. Like this: "aaa","bbb","ccc","ddd","eee","fff","ggg" But now i have a lot of enter(end of line) in text like this: "aaa","bbb","ccc","ddd","eee"," "" "" fff","ggg" How can i remove that... (8 Replies)
Discussion started by: snayper
8 Replies

9. UNIX for Dummies Questions & Answers

How can I replace the lines that start with a star and replace it with numbers start from 1?

I need to replace the (*) in the fist of a list with numbers using sed for example > this file contain a list * linux * computers * labs * questions to >>>> this file contain a list 1. linux 2. computers 3. labs 4. questions (7 Replies)
Discussion started by: aalbazie
7 Replies

10. UNIX for Beginners Questions & Answers

awk script to extract a column, replace one of the header and replace year(from ddmmyy to yyyy)

I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
Discussion started by: Kunalcurious
10 Replies
dfstab(4)							   File Formats 							 dfstab(4)

NAME
dfstab - file containing commands for sharing resources across a network DESCRIPTION
dfstab resides in directory /etc/dfs and contains commands for sharing resources across a network. dfstab gives a system administrator a uniform method of controlling the automatic sharing of local resources. Each line of the dfstab file consists of a share(1M) command. The dfstab file can be read by the shell to share all resources. System administrators can also prepare their own shell scripts to execute particular lines from dfstab. The contents of dfstab put into effect when the command shown below is run. See svcadm(1M). /usr/sbin/svcadm enable network/nfs/server SEE ALSO
share(1M), shareall(1M), sharemgr(1M), svcadm(1M) NOTES
Do not modify this file directly. This file is reconstructed and only maintained for backwards compatibility. Configuration lines could be lost. Use the sharemgr(1M) command for all share management. SunOS 5.11 15 Aug 2008 dfstab(4)
All times are GMT -4. The time now is 01:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy