02-18-2009
Thank you for the order. It works to add at the end of the line "chmod644" when a line contains the word "1".
What should I add to the command for adding the term "chmod644" is not done when the line contains the word "#".
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Anyone know how to use SED to append a comma to the end of each line
example:
field1,field2,field3,field4
If i Cat /textfile ---- How can i append the end of /textfile with a comman? (8 Replies)
Discussion started by: Redg
8 Replies
2. Shell Programming and Scripting
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies
3. UNIX for Advanced & Expert Users
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies
4. Shell Programming and Scripting
-Hi
I have multiple files which contain a line with the word "exec". I need to add the following pattern " -cmode -ccheap" on the same line where "exec" is at the end. Any idea? Thanks a lot in advance to everybody... -A (2 Replies)
Discussion started by: aoussenko
2 Replies
5. Shell Programming and Scripting
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies
6. Shell Programming and Scripting
Hello,
I'm new to this forum. I've been doing a lot of sed work lately and have found many useful tips on this forum. I've hit a roadblock in a project, though, and could really use some help.
I have a text file with many lines like the following, i.e., some lines begin with a single word... (3 Replies)
Discussion started by: paroikoi
3 Replies
7. Shell Programming and Scripting
Hello,
I have to add a new line at the end of a File on Solaris-System:
I think my script should be right, because I evaluated it to other threads. However the script does not what I am expected it should do.
My file might look like this:
Line1
Line2
Line3
And my script could... (7 Replies)
Discussion started by: Timo_HR
7 Replies
8. Shell Programming and Scripting
Hi,
I have a File, which have multiple rows.
Like below
123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY
123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY
I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies
9. Shell Programming and Scripting
hello everyone,
im new here, and also programming with awk, sed and grep commands on linux.
In my text i have many lines with this config:
1 1 4 3 1 1 2 5
2 2 1 1 1 3 1 2
1 3 1 1 1 2 2 2
5 2 4 1
3 2 1 1 4 1 2 1
1 1 3 2 1 1 5 4
1 3 1 1... (3 Replies)
Discussion started by: satir
3 Replies
10. Shell Programming and Scripting
hello Team,
I am looking for sed command or script which will append word at end of line. for example. I want to validate particular filesystem with mount |<filesystem name> command. if nodev parameter is not there then it should add in the fstab file with receptive to the filesystem.
# mount... (8 Replies)
Discussion started by: ghpradeep
8 Replies
LEARN ABOUT CENTOS
mail::dkim::textwrap
Mail::DKIM::TextWrap(3) User Contributed Perl Documentation Mail::DKIM::TextWrap(3)
NAME
Mail::DKIM::TextWrap - text wrapping module written for use with DKIM
SYNOPSIS (FOR MAIL::DKIM USERS)
use Mail::DKIM::TextWrap;
Just add the above line to any program that uses Mail::DKIM::Signer and your signatures will automatically be wrapped to 72 characters.
SYNOPSIS (FOR OTHER USERS)
my $output = "";
my $tw = Mail::DKIM::TextWrap->new(
Margin => 10,
Output => $output,
);
$tw->add("Mary had a little lamb, whose fleece was white as snow.
");
$tw->finish;
print $output;
DESCRIPTION
This is a general-purpose text-wrapping module that I wrote because I had some specific needs with Mail::DKIM that none of the contemporary
text-wrapping modules offered.
Specifically, it offers the ability to change wrapping options in the middle of a paragraph. For instance, with a DKIM signature:
DKIM-Signature: a=rsa; c=simple; h=first:second:third:fourth;
b=Xr2mo2wmb1LZBwmEJElIPezal7wQQkRQ8WZtxpofkNmXTjXf8y2f0
the line-breaks can be inserted next to any of the colons of the h= tag, or any character of the b= tag. The way I implemented this was to
serialize the signature one element at a time, changing the text-wrapping options at the start and end of each tag.
TEXT WRAPPING OPTIONS
Text wrapping options can be specified when calling new(), or by simply changing the property as needed. For example, to change the number
of characters allowed per line:
$tw->{Margin} = 20;
Break
a regular expression matching characters where a line break can be inserted. Line breaks are inserted AFTER a matching substring. The
default is "/s/".
BreakBefore
a regular expression matching characters where a line break can be inserted. Line breaks are inserted BEFORE a matching substring.
Usually, you want to use Break, rather than BreakBefore. The default is "undef".
Margin
specifies how many characters to allow per line. The default is 72. If no place to line-break is found on a line, the line will extend
beyond this margin.
Separator
the text to insert when a linebreak is needed. The default is "
". If you want to set a following-line indent (e.g. all lines but the
first begin with four spaces), use something like "
".
Swallow
a regular expression matching characters that can be omitted when a line break occurs. For example, if you insert a line break between
two words, then you are replacing a "space" with the line break, so you are omitting the space. On the other hand, if you insert a line
break between two parts of a hyphenated word, then you are breaking at the hyphen, but you still want to display the hyphen. The
default is "/s/".
CONSTRUCTOR
new() - create a new text-wrapping object
my $tw = Mail::DKIM::TextWrap->new(
Output => $output,
%wrapping_options,
);
The text-wrapping object encapsulates the current options and the current state of the text stream. In addition to specifying text wrapping
options as described in the section above, the following options are recognized:
Output
a scalar reference, or a glob reference, to specify where the "wrapped" text gets output to. If not specified, the default of STDOUT is
used.
METHODS
add() - process some text that can be wrapped
$tw->add("Mary had a little lamb.
");
You can add() all the text at once, or add() the text in parts by calling add() multiple times.
finish() - call when no more text is to be added
$tw->finish;
Call this when finished adding text, so that any remaining text in TextWrap's buffers will be output.
flush() - output the current partial word, if any
$tw->flush;
Call this whenever changing TextWrap's parameters in the middle of a string of words. It explicitly allows a line-break at the current
position in the string, regardless of whether it matches the current break pattern.
perl v5.16.3 2010-02-28 Mail::DKIM::TextWrap(3)