10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I am trying to insert a section of text between lines in another text file.
The new lines to be inserted are:
abcd.efgh.zzzz=blah
abcd.efgh.xxxx=blah
Where N = 0 to 2
Original File:
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb... (3 Replies)
Discussion started by: tsu3000
3 Replies
2. Shell Programming and Scripting
Hi I was wondering if anyone new of a solution to this problem? I need to copy a time stamp that is on a line of .text in a text file into multiple positions on the same line.
I need to insert the time stamp on the same line between every occurance of the text ".pdf_.html" right after the... (9 Replies)
Discussion started by: Paul Walker
9 Replies
3. Shell Programming and Scripting
Hi
I am trying to insert a block of text 2 lines above a pattern match using sed
eg
#Start of file entry
{
}
#End of file entry
new bit of text has to be put in just above the } eg
#Start of file entry
{
New bit of text
}
#End of file entry (7 Replies)
Discussion started by: eeisken
7 Replies
4. Shell Programming and Scripting
I have:
/path/to/my/fixdir/MD1234567.tar
I want to have:
/path/to/my/fixdir/MD/1234567.tar
fixdir never changes but MD does and how many numerical digits does. I want something like:
/usr/bin/sed 's/fixdir\/../fixdir\/..\//'
This ends up:
/path/to/my/fixdir/../1234567.tar
But... (3 Replies)
Discussion started by: crowman
3 Replies
5. Shell Programming and Scripting
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Discussion started by: psve
18 Replies
6. Shell Programming and Scripting
Hi,
I use sed to insert text at beginning of a file. But sed inserts a newline after my text that I do not need. For example, I want to insert "foo" at the beginning of my file:
> cat myfile
This is first line.
> sed -i '1i\foo' myfile
> cat myfile
foo
This is first line.
... (5 Replies)
Discussion started by: tdw
5 Replies
7. Shell Programming and Scripting
Hello. I'm trying to insert text in various positions and I could only do that using pipes for each position.
Example:
cat file | sed -e 's#\(.\{5\}\)\(.*\)#\1:\2#g' | sed -e 's#\(.\{26\}\)\(.*\)#\1:\2#g'
Insert ":" at position 5 and 26.
it can be done in the same sentence, without using... (4 Replies)
Discussion started by: </kida>
4 Replies
8. Shell Programming and Scripting
I know that
sed -n '12p' file
will print line 12 but how might I insert text to a specified line?
thanks (2 Replies)
Discussion started by: action_owl
2 Replies
9. Shell Programming and Scripting
Hi all,
I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output.
sed '$a\
hi...
' shell > shell1
But I face problem when using the same in script. It is throwing the error as,
sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies
10. UNIX for Dummies Questions & Answers
Hello. Trying to insert text at line 1 and after last line of file. I have searched posts but nothing seems to work. I keep getting extra characters error or nothing gets inserted into the file.
#!/bin/sh
touch textfile.txt
sed 'i\
Add this line before every line with WORD' textfile.txt
... (5 Replies)
Discussion started by: steveramsey
5 Replies
Mail::SpamAssassin::Plugin::Shortcircuit(3pm) User Contributed Perl Documentation Mail::SpamAssassin::Plugin::Shortcircuit(3pm)
NAME
Mail::SpamAssassin::Plugin::Shortcircuit - short-circuit evaluation for certain rules
SYNOPSIS
loadplugin Mail::SpamAssassin::Plugin::Shortcircuit
report Content analysis details: (_SCORE_ points, _REQD_ required, s/c _SCTYPE_)
add_header all Status "_YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ shortcircuit=_SCTYPE_ autolearn=_AUTOLEARN_ version=_VERSION_"
DESCRIPTION
This plugin implements simple, test-based shortcircuiting. Shortcircuiting a test will force all other pending rules to be skipped, if
that test is hit. In addition, a symbolic rule, "SHORTCIRCUIT", will fire.
Recomended usage is to use "priority" to set rules with strong S/O values (ie. 1.0) to be run first, and make instant spam or ham
classification based on that.
CONFIGURATION SETTINGS
The following configuration settings are used to control shortcircuiting:
shortcircuit SYMBOLIC_TEST_NAME {ham|spam|on|off}
Shortcircuiting a test will force all other pending rules to be skipped, if that test is hit.
Recomended usage is to use "priority" to set rules with strong S/O values (ie. 1.0) to be run first, and make instant spam or ham
classification based on that.
To override a test that uses shortcircuiting, you can set the classification type to "off".
on Shortcircuits the rest of the tests, but does not make a strict classification of spam or ham. Rather, it uses the default score
for the rule being shortcircuited. This would allow you, for example, to define a rule such as
body TEST /test/
describe TEST test rule that scores barely over spam threshold
score TEST 5.5
priority TEST -100
shortcircuit TEST on
The result of a message hitting the above rule would be a final score of 5.5, as opposed to 100 (default) if it were classified as
spam.
off Disables shortcircuiting on said rule.
spam
Shortcircuit the rule using a set of defaults; override the default score of this rule with the score from
"shortcircuit_spam_score", set the "noautolearn" tflag, and set priority to "-100". In other words, equivalent to:
shortcircuit TEST on
priority TEST -100
score TEST 100
tflags TEST noautolearn
ham Shortcircuit the rule using a set of defaults; override the default score of this rule with the score from
"shortcircuit_ham_score", set the "noautolearn" and "nice" tflags, and set priority to "-100". In other words, equivalent to:
shortcircuit TEST on
priority TEST -100
score TEST -100
tflags TEST noautolearn nice
shortcircuit_spam_score n.nn (default: 100)
When shortcircuit is used on a rule, and the shortcircuit classification type is set to "spam", this value should be applied in place
of the default score for that rule.
shortcircuit_ham_score n.nn (default: -100)
When shortcircuit is used on a rule, and the shortcircuit classification type is set to "ham", this value should be applied in place of
the default score for that rule.
TAGS
The following tags are added to the set available for use in reports, headers etc.:
_SC_ shortcircuit status (classification and rule name)
_SCRULE_ rulename that caused the shortcircuit
_SCTYPE_ shortcircuit classification ("spam", "ham", "default", "none")
SEE ALSO
"http://issues.apache.org/SpamAssassin/show_bug.cgi?id=3109"
perl v5.14.2 2011-06-06 Mail::SpamAssassin::Plugin::Shortcircuit(3pm)