sed s command works on strings, not input files!
Further, the strings are regular expressions - not wanted here.
But there are other Unix tools:
If you don't want the intermediate patchfile:
This looks promising. I know now that sed likes literal strings and not input files . I love learning code and am excited that there is a community here willing to share their knowledge when I have problems finding it on my own.
@Joeyg, I like your approach as well, this helps me to understand some more commands. Does the head and tail commands used in this context copy the selected lines to files t1 and t2, and then im a little lost what the cat command does to mytext.txt and newfile.txt, assuming that new.txt has the information in my replaceccore file.
---------- Post updated at 06:45 PM ---------- Previous update was at 06:32 PM ----------
This worked like a charm!
---------- Post updated at 06:55 PM ---------- Previous update was at 06:45 PM ----------
Can any one give me the idea on replacing multiple blank lines with a single blank line?
Please conside it for a file having more than 100 number of characters.
Regards,
Siba (3 Replies)
Hey guys,
I'm kinda a noob at scripting. I am trying to create a script that uses multiple for loops with the lsiutility to monitor disk health on a system.
The script runs, but it will continually echo an infinite number of LogVolumes when there are only 2 per virtual disk on my server. It's... (2 Replies)
Hi there, I have the following output,
# raidctl -l
RAID Volume RAID RAID Disk
Volume Type Status Disk Status
------------------------------------------------------
c0t1d0 IM OK c0t1d0 OK
... (4 Replies)
Hi,
I have a file with below contents,
ssenthil = rw
anilkg = rw
I want to search for "ssenthil" and need to delete line 1 and 2 , if the third line starts with "" respectively and blank line immediately and third line starts with "
anilkg = rw
Please help me .
Great day... (5 Replies)
Hi,
Can anyone help me out for my below problem.
I need to replace all System.out.println with Logger.println in *.java using SED (spanning multiple lines)
including current & sub-directories.
I tried with below command. But it is not replacing when source text is spanned over multiple... (4 Replies)
Hi
Am confused with the usage of "sed" command
I want to replace a single line with multiple lines of a file..
eg.,
A file has
Hi, How are you?
I need to replace as
Am fine
What are You doing?
I used the script as
string1="Hi, How are you?"
echo "$string1 is the value"... (4 Replies)
Hi
I am new to Ubuntu and Bash scripting. I am working on a project to give a demo on an SDN application to my class. I need some help in scripting to create the demo. Please help in case if you have any idea on what am asking.
The demo uses a tool called mininet. I need just one script so... (2 Replies)
Im looking for a bash solution that will use Regular Expressions (not perl, sed or awk) to check the example data below and then give me a status.
which would be just simply Match or Mismatch.
SYS PS1 is present.
Fan status: Normal
Input Voltage status: Normal
... (5 Replies)
Discussion started by: popeye
5 Replies
LEARN ABOUT DEBIAN
debtags-submit-patch
DEBTAGS-SUBMIT-PATCH(1) User Commands DEBTAGS-SUBMIT-PATCH(1)NAME
debtags-submit-patch - submit tag patches to http://debtags.debian.net
SYNOPSIS
debtags-submit-patch [-t TAG] [options] [patchfile [patchfile...]]
DESCRIPTION
Submits a tag patch to the Debtags website. Each patch file is submitted in a different query.
OPTIONS --version
show program's version number and exit
-h, --help
show this help message and exit
-t tag, --tag=tag
tag the patch with the given string (default: 24f895dcbabc389804e5).
-q, --quiet
quiet mode: only output errors.
-v, --verbose
verbose mode: output progress and non-essential information.
--stdin
read patch from standard input.
--url=url
URL to submit to (default: http://debtags.debian.net/api/patch).
--dump-http-error=file
if the server returns an error, dump the contentsof the error page to the given file (default:discard the error page).
Patch files can be generated with 'debtags diff' or 'tagcoll diff'.
Patch submissions are marked with a tag of your choice. It does not need to identify yourself (but feel free to use your email address),
but reusing your tag allows to handle all your edits as if they were a single one. This helps greatly when tags are reviewed.
By default, a mostly persistent but anonymous tag is generated by hashing your passwd entry.
debtags-submit-patch 1.8 June 2012 DEBTAGS-SUBMIT-PATCH(1)