09-16-2008
okay here's my script
im a nub in unix so im doing exercises right now
#!/bin/ksh
clear
echo "START"
cat hl.dsldryloop | awk -F\| '{if(NR==1){print $1"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9"|""TEST"} else{print }}' > title.t
xt
cat title.txt | sed q > titlefinal.txt
grep '^090' hl.dsldryloop | awk -F\| '{print $1"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9"|CF5857|"}' > search1.txt
grep -v '^090' hl.dsldryloop > contents.txt
grep -v 'NPAN' contents.txt > contents2.txt
grep '^087' contents2.txt | awk -F\| '{print $1"|"$2"|"$3"|"$4"|"$5"|PHI|"$7"|"$8"|"$9"|"}' > search2.txt
grep -v '^087' contents2.txt > contents3.txt
grep '^063' contents3.txt | awk -F\| '{print $1"|"$2"|"$3"|TBWS|"$5"|"$6"|"$7"|"$8"|"$9"|"}' > search3.txt
grep -v '^063' contents3.txt > contents4.txt
grep -v '|||' contents4.txt > contents5.txt
cat contents5.txt search1.txt search2.txt search3.txt > full.txt
sort full.txt > fullsorted.txt
cat titlefinal.txt fullsorted.txt > final.txt
mv final.txt ../ETC/hl.dsldryloop
chmod 666 ../ETC/hl.dsldryloop
exit 0
I use putty
Unix
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Solaris v5.6
What log files should be checked out as part of your sys admin daily routine?
I've printed out my syslog.conf file, and looked in /var/log and found authlog, syslog, and POPlog. I know of /var/adm/messages.
What others should I be looking for?
I know of the "find" command. I... (8 Replies)
Discussion started by: Westy564
8 Replies
2. AIX
hi..
Where can i find the major logfiles in AIX 5.3 and which all log files should be cleared periodically??
Bala (5 Replies)
Discussion started by: balaji_prk
5 Replies
3. UNIX Desktop Questions & Answers
I have a incoming print stream from a Open Vms server that I need to redirect to a log file. The print stream comes in via a IP address and port onto the Unix server. Does anyone know the command and syntax that I will need to use to achieve this?
Thanks (0 Replies)
Discussion started by: shepheri
0 Replies
4. UNIX for Dummies Questions & Answers
hi,
can anybody tell me what are the log files availablr in unix? (4 Replies)
Discussion started by: palash2k
4 Replies
5. Shell Programming and Scripting
Hello,
i got the bunch of files, with following extention
*.log.* eg: test.log.2009-01-01
i want them to be gz as test.log.2009-01-01.gz
and delete the src files on /home/capture
can some one help me with creating the shell script. (1 Reply)
Discussion started by: boomramada
1 Replies
6. Shell Programming and Scripting
How can view log messages between two time frame from /var/log/message or any type of log files.
when logfiles are very big and especially many messages with in few minutes, I would like to display log messages between 5 minute interval.
Could you pls give me the command? (1 Reply)
Discussion started by: johnveslin
1 Replies
7. Shell Programming and Scripting
we r to develope a project which involves automatic encryption of all the text files user was working upon during logg off
and to decrypt them during log on
this is to be done by writing a shell script
can anyone help (2 Replies)
Discussion started by: vyom
2 Replies
8. Shell Programming and Scripting
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies
9. Shell Programming and Scripting
is there a way to efficiently monitor logfiles that do not have a date or time format? i have several logs on several different servers that need to be monitored. but i realized writing a script for this would be very complex and time consuming giving the variety of things i need to check for i.e.... (2 Replies)
Discussion started by: SkySmart
2 Replies
10. Shell Programming and Scripting
Redirecting log files to null writing junk into log files.
i have log files which created from below command
exec <processname> >$logfile
but when it reaches some size i am redirecting to null while process is running like
>$logfile
manually but after that it writes some junk into... (7 Replies)
Discussion started by: greenworld123
7 Replies
FPRINTF(3) 1 FPRINTF(3)
fprintf - Write a formatted string to a stream
SYNOPSIS
int fprintf (resource $handle, string $format, [mixed $args], [mixed $...])
DESCRIPTION
Write a string produced according to $format to the stream resource specified by $handle.
PARAMETERS
o $handle
-A file system pointer resource that is typically created using fopen(3).
o $format
- See sprintf(3) for a description of $format.
o $args
-
o $...
-
RETURN VALUES
Returns the length of the string written.
EXAMPLES
Example #1
fprintf(3): zero-padded integers
<?php
if (!($fp = fopen('date.txt', 'w'))) {
return;
}
fprintf($fp, "%04d-%02d-%02d", $year, $month, $day);
// will write the formatted ISO date to date.txt
?>
Example #2
fprintf(3): formatting currency
<?php
if (!($fp = fopen('currency.txt', 'w'))) {
return;
}
$money1 = 68.75;
$money2 = 54.35;
$money = $money1 + $money2;
// echo $money will output "123.1";
$len = fprintf($fp, '%01.2f', $money);
// will write "123.10" to currency.txt
echo "wrote $len bytes to currency.txt";
// use the return value of fprintf to determine how many bytes we wrote
?>
SEE ALSO
printf(3), sprintf(3), sscanf(3), fscanf(3), vsprintf(3), number_format(3).
PHP Documentation Group FPRINTF(3)