11-07-2001
Loop not working
Apologize if this is doesn't come under this group. I have a small script to find out users who last logged in to check there mail. (Tru 64 4.0, Netscape mail 3.6)
----->
cat $1|awk -F: '$2=="SMTP-Accept" && $5~/@maildomain/ {s=$5;u[s]++;las=substr($1)} END {for (i in u) {print i,u[i],las}}'|sort>>/tmp/mailusage.list
<-----
It works when I run it with just one file (e.g script log20011107). But bombs out when I give command: script log*. It checks the first file only.
I tried to put another for loop for the script, but no good. Any suggestions. TIA, Ciao,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello
i am trying to remove a line using an input file , but this depends upon user interaction
here is the sample
#!/bin/sh
echo "Please enter whether you want to remove Profile"
read value1
if ;then
sed /movie/d temp.txt> temp3.txt
else
echo "Script didnot remove profile"
fi
... (3 Replies)
Discussion started by: ranga27
3 Replies
2. Shell Programming and Scripting
Could some one help me on this... For loop is working...!
for x in $i
do
for y in $j
do
z=`echo $y | awk '{print $2}'`
if
then
FS=`/usr/bin/echo $y`
echo $FS >>$Basic_location/out.csv
fi
done
CPRT="Cpoyright @ BTOIDCIM"
done (3 Replies)
Discussion started by: bullz26
3 Replies
3. UNIX for Dummies Questions & Answers
If then else segment of below code is not working. For each filename code is displaying output for if part as well as else part. Please help its urgent.
for usercusttop in `echo ${filename}|sort|uniq|cut -c 1-${actualwordcount}`
do
... (2 Replies)
Discussion started by: findprakash
2 Replies
4. UNIX for Advanced & Expert Users
The following piece of code is not running because it is fails to go inside the if condition. i want to create a directory if there is no directory in the input path. i am using Linux, by CENT. Please help.
echo " Enter the path where you u want to extract the tar"
read EXTRACT_PATH
ls -ld... (12 Replies)
Discussion started by: toanilsharma1
12 Replies
5. Shell Programming and Scripting
here we go..
While loop is not working file.. It also invokes one more shell scripts for which parameters need to passed on.
while read line
do
####
#### We want to have a logfile for each load
####
PLog="${LogDir}/${Script}.log";
####
... (5 Replies)
Discussion started by: premkumardr
5 Replies
6. Shell Programming and Scripting
hi everyone
i am facing a very strange problem . please help me why my while loop is not working.
below is my code
#!/bin/ksh
file=RCMC_ABC_999_080924_210813.DAR
echo ${file}
value=001
count=10
echo "abc"
echo ${count}
value=$((${value} + 1 ))
echo ${value}
while ]
do
echo... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies
7. Shell Programming and Scripting
Hi All,
For loop in ksh not working if it was given in the following method.
simple script:
for i in {1..4}
do
echo $i
done
Output:
{1..4}
Even below also not working :(
Script:
for (( c=1; c<=5; c++ )) do echo "Welcome $c times..." done
Output:
./x.sh: 0403-057 Syntax error... (13 Replies)
Discussion started by: girish_satyam
13 Replies
8. Programming
Hi new to C give me a hand thank.
do
{
bzero(input,256);
printf("Please enter the country name!");
scanf("%s",input); //& character is essential for scanf(), %f = float, %399s as the last character to be the null character ('\0').
}
while... (5 Replies)
Discussion started by: GQiang
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have ten different files to extract. so I thought for loop will help me. but it's not working for me. Please advice what I am doing wrong.
for INCI in 1 2 3 4 5 6 7 8 9 10
do
tar -xvf Update_INCI11.10.002_lnx86_1of10.tar
done
second file name is... (3 Replies)
Discussion started by: samnyc
3 Replies
10. Shell Programming and Scripting
Hello all,
I would like to unzip some files with a for-loop.
Is there anyone who could tell me how I should do this - in a correct way?
for file in $(ls); do echo gzip -d < $file | tar xf -; done
The problem is the pipe - I believe. But how could I do it? I need it for the command... (4 Replies)
Discussion started by: API
4 Replies
LEARN ABOUT DEBIAN
nms2dlf
NMS2DLF.IN(1) LogReport's Lire Documentation NMS2DLF.IN(1)
NAME
nms2dlf - convert Netscape Messaging Server SMTP log files to the email DLF
SYNOPSIS
nms2dlf STDIN STDOUT
DESCRIPTION
This program converts Netscape Messaging Server log file generated by the SMTP service to the email DLF.
To process correctly the log file, you need to turn on logging of the following modules:
- SMTP-Accept
- SMTP-Deliver
- Error-Handler
- Mailbox-Deliver (Need to be enabled)
LIMITATIONS
This DLF converter was developed for the Netscape Messaging Server version 4.1. Other versions may or may not work. Contact the LogReport
developers if you have problems with that converter.
You can find information about the log format used by Netscape Messaging Server at the following URL:
http://developer.netscape.com/docs/manuals/messaging/41/ag/logging.htm
Not all messages are documented. And we found errors in the documentation. The fields msgID and mailFrom are inversed in both SMTP-Accept
and SMTP-Deliver from what described the documentation.
CONFIGURING LOGGING OF MAILBOX-DELIVER MODULE
We found that there are no logs from the Mailbox-Delivery module by default. In order to fix that problem please make sure you do the
following:
1. Go on the Netscape Messaging Server 4 MTA or Message Store
2. Become the Mail Server user (usually this should not be root but typically a user like mailsrv or whatever was defined at installation
time, check for the ownership of the files in your message server instance for example)
3. Go to the right location, something like: server-root/msg-instance
For example it could be: /usr/netscape/server4/msg-mymailserver
4. Do:
$ ./configutil -o service.smtp.mailbox-deliver.log -v yes
OK SET
5. Then become root, go again to your instance directory like: /usr/netscape/server4/msg-mymailserver and do:
# ./stop-msg smtp
/usr/netscape/server4: Stopping SMTP daemon 16279 .... done: 16279
# ./start-msg smtp
/usr/netscape/server4: Starting SMTP daemon ..... done: 10820
And then you will start seeing lines which will look like the following:
[19/Jul/2002:08:31:54 +0200] amail2 smtpd[10820]:
General Notice: SMTP-Accept:GZHGT501.C01:<200207190632.g6J6W7Y01389@
esmtp.orangemail.ch>:[192.168.30.2]:192.168.30.2:
<newsletter@gamezone.com>:19514:1:<hmarmy@orangemail.ch>
[19/Jul/2002:08:31:54 +0200] amail2 smtpd[10820]: General Notice:
Mailbox-Deliver:GZHGT501.C01:<200207190632.g6J6W7Y01389@
esmtp.orangemail.ch>:19516:1:hmarmy;
If this was not done the line with the pattern Mailbox-Deliver above will not be present and the program will give wrong results. A warning
will be output in the error log.
EXAMPLES
To process a log as produced by Netscape Messaging Server
$ nms2dlf < mail.log
nms2dlf will be rarely used on its own, but is more likely called by lr_log2report:
$ lr_log2report nms < /var/log/mail.log
VERSION
$Id: nms2dlf.in,v 1.10 2006/07/23 13:16:34 vanbaal Exp $
COPYRIGHT
Copyright (C) 2002 Stichting LogReport Foundation <logreport@LogReport.org> Copyright (C) 2002 Arnaud Taddei Copyright (C) 2002 Arnaud
Gaillard
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
AUTHORS
Francis J. Lacoste <flacoste@logreport.org>, Arnaud Taddei <Arnaud.Taddei@sun.com> and Arnaud Gaillard <wireless@orange.ch>
Lire 2.1.1 2006-07-23 NMS2DLF.IN(1)