sorry to ask this again
in the input file i have 2 columns and the logic should be applied on col2 and the 2 columns are separated by comma in the input file.The outfile should have 2 columns in the file and 3rd derived column separated by comma.
Code:
input file
outputfile
1,ABC
1,ABC, ABCXXXX
2,ABCD
2,ABCD,ABCDXXXXX
3,ABCDX
3,ABCDX,ABCDXXXXXX
4,ABCDXX
4,ABCDXX,ABCDXX
5,ABCDXXX
5,ABCDXXX,ABCDXXX
6,ABCDXXXX
6,ABCDXXXX,ABCDXXXX
7,ABCXXX
7,ABCXXX,ABCXXX
8,A
8,A,AXXXXX
9,B
9,B,BXXXXX
Thanks again
dsdev
Last edited by dsdev_123; 07-29-2011 at 04:30 PM..
Reason: Code tags.
Hi All,
Are there any logic to extract the only lines between first two *TM* (which is marked in blue)?
VOL1HST99 0
HDR1A999999S 999999HST99
HDR2F001200012001
UHL1 0729609000001 000000
*TM*^^^^^^^^^^^^^^^^^^^^^^
01012610252171017301805000... (2 Replies)
hi;
i need a script which will go to all directories and subdirectories and print the filenames as follow;
here i m printing only files listing in current directory
reason i m doing this is coz i want to perform some operations according to filename achieved so cant use find command;... (4 Replies)
Hi All
I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please?
E.g of the problem.
The directory A is having sub directory which are having subdirectory an so on.
I need a command which will find the... (2 Replies)
I need to implement a looping logic.
If then
Go to /path1/file*
Get all the filename starting with file* and store it in a array
count file number and store it in variable like run
Ex: I found 3 file with starting file* so my run = 3
means my loop should run three time
May be... (1 Reply)
Having trouble with the logic when looping over this switch case again:
for (j = 0; data != 0; j++){
switch(data){
case 'c':
output = ranit(r_brace_array);
break;
case 'h':
output = ranit(pipe_array);
break;
... (6 Replies)
Discussion started by: Azrael
6 Replies
LEARN ABOUT XFREE86
escape
escape(1) Mail Avenger 0.8.3 escape(1)NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)