Franklin, it seems to mostly work, could you please explain it a little?
Explanation:
With sed you can save substrings with \(.*\) and recall them back with \1, \2, \3 etc.
\(.*STDM.\).\(.*\)
The 1st portion \(.*STDM.\) is from the start of the line till the character after STDM (hence the dot)
The 2st portion .\(.*\) is from one character after the 1st portion (hence the dot before the substring) till the end of the line
\16\2
\1 -> print the 1st portion 6 -> print a "6" \2 -> print the 2nd portion
Hello,
in my shell script i have some multi-line text in a variable $TEMP - f.e.
blablahblah
blah blah
bla TARGET hgloglo
And i need to replace TARGET with text from another variable ($REPLACE), which is containing some text with nasty characters (\n, ", :, etc.) And stuff the altered text... (2 Replies)
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)
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Hi Can someone help me with this one?
I have string..
(PROC_PROC_ID == 12183) <--PID is dynamic
and i want to replace the PID number with whatever PID from
/opt/hpws/apache32_2/logs/httpd.pid file.
i'm having problem since the PID on the string is dynamic. It may be 2-5 digits or more.
... (5 Replies)
Hi all,
I need to run a number of scripts which have a certain phrase on them so I have identified these by;
grep -l 100 *script | sort -u
Normally I could just run something along the lines of;
for i in `grep -l 100 *script | sort -u`; do ./${i}; done
However before I run each of... (0 Replies)
Ok,
So I have a huge file that has over 12000 lines in it.
in this file, there are 589 occurrences of the string "use five-minute-interval" spread in various areas in the file.
How can i replace the the last 250 of the occurrences of "use five-minute-interval" with "use... (10 Replies)
Hi experts,
My csv file looks like this
U;cake;michael;temp;;;;
U;bread;john;temp;;;;
U;cocktails;sarah;temp;;;;
I'd like to change the value fo 2nd column to cf+random number , which will look maybe something like this
U;cf20187;michael;temp;;;;
U;cf8926;john;temp;;;;... (7 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Here is my problem:-
I have a file with pipe separated values.
CR|20121021|079|ABC|N|DLS|00038|DLS|04750|1330597704|634234|634|0
CR|20121021|079|ABC|N|DLS|00038|DLS|05118|2071690102|354|351|3
CR|20121021|079|ABC|N|DLS|00038|DLS|05140|960051505|1088|1088|0... (4 Replies)
Hello
Take this file...
Test01
Ref test
Version 01
Test02
Ref test
Version 02
Test66
Ref test
Version 66
Test99
Ref test
Version 99
I want to substitute every occurrence of Test{2} with a unique random number, so for example, if I was using sed, substitution would be something... (1 Reply)
Discussion started by: funkman
1 Replies
LEARN ABOUT MOJAVE
qmail-command
qmail-command(8) System Manager's Manual qmail-command(8)NAME
qmail-command - user-specified mail delivery program
SYNOPSIS
in .qmailext: |command
DESCRIPTION
qmail-local will, upon your request, feed each incoming mail message through a program of your choice.
When a mail message arrives, qmail-local runs sh -c command in your home directory. It makes the message available on command's standard
input.
WARNING: The mail message does not begin with qmail-local's usual Return-Path and Delivered-To lines.
Note that qmail-local uses the same file descriptor for every delivery in your .qmail file, so it is not safe for command to fork a child
that reads the message in the background while the parent exits.
EXIT CODES
command's exit codes are interpreted as follows: 0 means that the delivery was successful; 99 means that the delivery was successful, but
that qmail-local should ignore all further delivery instructions; 100 means that the delivery failed permanently (hard error); 111 means
that the delivery failed but should be tried again in a little while (soft error).
Currently 64, 65, 70, 76, 77, 78, and 112 are considered hard errors, and all other codes are considered soft errors, but command should
avoid relying on this.
ENVIRONMENT VARIABLES
qmail-local supplies several useful environment variables to command. WARNING: These environment variables are not quoted. They may con-
tain special characters. They are under the control of a possibly malicious remote user.
SENDER is the envelope sender address. NEWSENDER is the forwarding envelope sender address, as described in dot-qmail(5). RECIPIENT is
the envelope recipient address, local@domain. USER is user. HOME is your home directory, homedir. HOST is the domain part of the recipi-
ent address. LOCAL is the local part. EXT is the address extension, ext.
HOST2 is the portion of HOST preceding the last dot; HOST3 is the portion of HOST preceding the second-to-last dot; HOST4 is the portion of
HOST preceding the third-to-last dot.
EXT2 is the portion of EXT following the first dash; EXT3 is the portion following the second dash; EXT4 is the portion following the third
dash. DEFAULT is the portion corresponding to the default part of the .qmail-... file name; DEFAULT is not set if the file name does not
end with default.
DTLINE and RPLINE are the usual Delivered-To and Return-Path lines, including newlines. UFLINE is the UUCP-style From_ line that qmail-
local adds to mbox-format files.
SEE ALSO dot-qmail(5), envelopes(5), qmail-local(8)qmail-command(8)