9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
2. Shell Programming and Scripting
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
3. Shell Programming and Scripting
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
4. Shell Programming and Scripting
I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file.
The file length will depend on the numbers of Earnings/Deductions/Direct Deposits.
The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
5. Shell Programming and Scripting
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
6. UNIX for Dummies Questions & Answers
I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file:
And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
7. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
8. Shell Programming and Scripting
I have another question, I am very new to scripting. I am using c shell.
I am trying to get the length of a variable. Right now I am using
set var = 12
but the # operator isn't working, it is telling me that the length is 1 when it is obviously two....
help! (3 Replies)
Discussion started by: karyn1617
9. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
escape(1) Mail Avenger 0.8.3 escape(1)
escape - escape shell special characters in a string
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
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
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:
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"
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
bodytest reject_bcc `escape "$RECIPIENT"`
The Mail Avenger home page: <http://www.mailavenger.org/>.
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
Mail Avenger 0.8.3 2012-04-05 escape(1)