Sponsored Content
Full Discussion: Loop not working
Top Forums Shell Programming and Scripting Loop not working Post 10056 by LivinFree on Wednesday 7th of November 2001 01:50:11 AM
Old 11-07-2001
You mention that you already tried looping it...
It didn't work when you did something like this?:

for each in `ls -1 log*`
do
cat $each|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
done

What happened when you tried that?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if loop is not working

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

For loop not working...! :(

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 loop not working

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

If loop is not working

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

While loop not working

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

while loop not working

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

For loop not working

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

C While Loop not working like C++

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

for loop not working

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

For-loop not working

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
Mail::Util(3)						User Contributed Perl Documentation					     Mail::Util(3)

NAME
Mail::Util - mail utility functions INHERITANCE
Mail::Util is a Exporter SYNOPSIS
use Mail::Util qw( ... ); DESCRIPTION
This package provides several mail related utility functions. Any function required must by explicitly listed on the use line to be exported into the calling package. FUNCTIONS
mailaddress([ADDRESS]) Return a guess at the current users mail address. The user can force the return value by setting the MAILADDRESS environment variable. [2.10] You may set the ADDRESS via the parameter. WARNING: When not supplied via the environment variable, <mailaddress> looks at various configuration files and other environmental data. Although this seems to be smart behavior, this is not predictable enough (IMHO) to be used. Please set the MAILADDRESS explicitly, and do not trust on the "automatic detection", even when that produces a correct address (on the moment) example: # in your main script $ENV{MAILADDRESS} = 'me@example.com'; # everywhere else use Mail::Util 'mailaddress'; print mailaddress; # since v2.10 mailaddress "me@example.com"; maildomain() Attempt to determine the current user mail domain string via the following methods o Look for the MAILDOMAIN environment variable, which can be set from outside the program. This is by far the best way to configure the domain. o Look for a sendmail.cf file and extract DH parameter o Look for a smail config file and usr the first host defined in hostname(s) o Try an SMTP connect (if Net::SMTP exists) first to mailhost then localhost o Use value from Net::Domain::domainname (if Net::Domain exists) WARNING: On modern machines, there is only one good way to provide information to this method: the first; always explicitly configure the MAILDOMAIN. example: # in your main script $ENV{MAILDOMAIN} = 'example.com'; # everywhere else use Mail::Util 'maildomain'; print maildomain; read_mbox(FILE) Read FILE, a binmail mailbox file, and return a list of references. Each reference is a reference to an array containing one message. WARNING: This method does not quote lines which accidentally also start with the message separator "From", so this implementation can be considered broken. See Mail::Box::Mbox SEE ALSO
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/. AUTHORS
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development. Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog. LICENSE
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark Overmeer <perl@overmeer.net>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.18.2 2014-01-05 Mail::Util(3)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy