Sponsored Content
Top Forums Shell Programming and Scripting sed substitution or awk, need to direct change the file Post 302683187 by Corona688 on Tuesday 7th of August 2012 10:26:39 AM
Old 08-07-2012
Even some implementations of ed may create a temp file.

It's never a good thing to edit your originals. If you screw up, you've lost data.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change ip using awk or sed .

How to change ip using awk or sed . #cat /etc/hosts 10.151.5.1 server1 10.151.5.2 server2 10.151.5.3 server3 10.151.5.4 server4 10.151.5.5 server5 Output: 10.151.5.1 server1 10.181.5.2 server2 10.151.5.3 server3 10.181.5.4 server4 10.181.5.5 server5 (9 Replies)
Discussion started by: kenshinhimura
9 Replies

2. Shell Programming and Scripting

How to change a substitution value in a file?

Hi, i want to change a subs. value in a file, with using a script.. this is my script... (example) #!/bin/bash NDIR=`zenity --file-selection --directory` mv $HOME/Desktop/myfile /tmp/myfile.temp XT='"' perl -pe "s/.*/DIR=$XT`echo -e "$NDIR"`$XT/ if $. == 40" <... (2 Replies)
Discussion started by: excsra
2 Replies

3. Shell Programming and Scripting

KSH: substitution character, AWK or SED?

Hi Gurus, I am working with a korn shell script. I should replace in a very great file the character ";" with a space. Example: 2750;~ 2734;~ 2778;~ 2751;~ 2751;~ 2752;~ what the fastest method is? Sed? Awk? Speed is dead main point, Seen the dimensions of the files Thanks (6 Replies)
Discussion started by: GERMANICO
6 Replies

4. Shell Programming and Scripting

sed returns different results while substitution on a pipe delimited file

Hi, Need help with a sed command that I am using to substitute 3 positions of a pipe delimited file. i am getting different results while substituting the same position of two different files with the same value. Please see details below: $ cat chk2 ... (3 Replies)
Discussion started by: vmenon
3 Replies

5. Shell Programming and Scripting

Manipulating sed Direct Input to Direct Output

Hi guys, been scratching round the forums and my mountain of resources. Maybe I havn't read deep enough My question is not how sed edits a stream and outputs it to a file, rather something like this below: I have a .txt with some text in it :rolleyes: abc:123:xyz 123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies

6. Shell Programming and Scripting

Awk:substitution of characters between two file elements

Hi, I have file1 like this: a 64 b 66 c 67and file2 like this: @1234 1123 aabbcc @5453 5543 ccbaI want to replace each letter of the third line in file2 with corresponding number in file1. So desired output is, @1234 1123 646466666767 @5453 5543 67676664I tried something like... (4 Replies)
Discussion started by: polsum
4 Replies

7. Shell Programming and Scripting

sed - String substitution within specified section in ini type file

Hello. I am trying to modify a config file which is in windows *.ini type file. I have found a piece of code here :linux - Edit file in unix using SED - Stack Overflow As I can't make it doing the job , I am trying to find a solution step by step. here a modified sample file : my_sample.ini... (1 Reply)
Discussion started by: jcdole
1 Replies

8. Shell Programming and Scripting

Datestamp format 2nd change in csv file (awk or sed)

I have a csv file formatted like this: 2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances. I have got this: awk -F, 'NR <=1 {print;next}{"date +%d/%m/%Y\" \"%H:%m -d\""$1 "\""| getline dte;$1=dte}1' OFS="," test.csvThis... (6 Replies)
Discussion started by: say170
6 Replies

9. Shell Programming and Scripting

Sed/awk/perl substitution with multiple lines

OSX I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code... (3 Replies)
Discussion started by: sudo
3 Replies

10. UNIX for Beginners Questions & Answers

Using sed to change file into an awk script

Hi I want to use sed to change a text files input into an awk script. For example if the input says " chord -- english " I want to change this using sed 's/pattern 1 /pattern 2 /'g filename but I don't understand how to use part of the pattern 1 to input that into pattern 2 . Like after... (10 Replies)
Discussion started by: enforcer
10 Replies
ESPDIFF(1)							     Man pages								ESPDIFF(1)

NAME
espdiff - apply the appropriate transformation to a set of patches SYNOPSIS
espdiff [--deep-brainwave-mode] [--recurse] [--compare] [file...] espdiff {[--help] | [--version]} DESCRIPTION
espdiff applies the appropriate transformation to a patch or set of patches, depending on what you intend to accomplish. The input patches must be "clean": in other words they must apply without fuzz or offsets in whichever order they are meant to be applied. The exception is if you intend espdiff to clean them for you (good luck). You may find it useful to cross your fingers while the program performs its task, or to screw your eyes tight shut while imagining it doing the right thing. OPTIONS
--deep-brainwave-mode Probes your brain deeply in a manner that takes longer, but produces better extra sensory results. --recurse Recurses neural pathways throughout all parts of the brain, in some cases determining code changes you might make far off in the future. You may feel a gentle tickling sensation when using this option. --compare Allows the program to scan the current directory examining existing patches to determine areas of code you are likely to change again, and concentrating on these areas more closely. --help Display a short usage message. --version Display the version number of espdiff. LIMITATIONS
Do not use this program while sleep-walking, or before your first cup of coffee. There are some cases in which it is not possible to determine what the intention of the user is. In these cases, you should construct the output you desire using an editor, and send the input files together with the desired output file to Tim Waugh twaugh@redhat.com asking for a new diff tool. AUTHORS
Tim Waugh <twaugh@redhat.com> Package maintainer Mike Harris <mharris@redhat.com> Conceptual designer patchutils 5 March 2003 ESPDIFF(1)
All times are GMT -4. The time now is 05:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy