Sponsored Content
Top Forums Shell Programming and Scripting Hotfolder with inotify-tools, loop FOR not working Post 303015693 by pasaico on Tuesday 10th of April 2018 09:37:31 AM
Old 04-10-2018
Quote:
Originally Posted by apmcd47
Presumably, going back to your original script, you want to move the file and email confirmation if the email address(es) exist. What happens if there is no email address? Move anyway? Or is that an error?
If there are no email addresses, the file is moved into a directory named ERROR

Code:
error=${HOTFOLDER}/$(date +'ERROR-%F')
                mkdir -p "${error}" && mv "${fullpath}" "${error}"

why with:

Code:
[[ -n "$mail"  ]] #work
[[ "$mail" = '' ]] #not work?

Thank you Andrew

pasaico
 

9 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. 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

4. SCO

inotify() in SCO UNIX

Hi I'm going to write a program in C language to watch activity on file system in SCO UNIX openserver 5.0.6. Apparently Linux provide an API called "inotify" , I'm wondering what's the SCO UNIX package for this ? (1 Reply)
Discussion started by: javad1_maroofi
1 Replies

5. 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

6. UNIX for Advanced & Expert Users

Dynamically add paths to inotify

I have initiated an inotify process with --fromfile option and the file contain the paths to be monitored. /usr/local/maldetect/inotify/inotifywait -d -r -o /usr/local/maldetect/inotify/inotify_log --fromfile /usr/local/maldetect/sess/inotify.paths.28364 --exclude (^/var/tmp/mysql.sock)... (2 Replies)
Discussion started by: anil510
2 Replies

7. 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

8. Red Hat

Issues installing inotify-tools on RedHat Linux

I wish to install inotify-tools-3.20.1-2.4.x86_64.rpm on Linux and fire inotifywait command. Initially i was looking for "inotify-tools-3.xx.tar.gz" as instructed here http://jensd.be/248/linux/use-inotify-tools-on-centos-7-or-rhel-7-to-watch-files-and-directories-for-events I have... (9 Replies)
Discussion started by: mohtashims
9 Replies

9. UNIX for Advanced & Expert Users

Tip: inotify cron

Dear members, moderators and others. While working on <insert project>, a need has surfaced to watch a directory, and when a file comes, to do appropriate action. So, i started writing some shell code, aware of linux inotify-tools package with inotifywait. Also, i'm seeing a lot of similar... (1 Reply)
Discussion started by: Peasant
1 Replies
mlmmj-unsub(1)						      General Commands Manual						    mlmmj-unsub(1)

NAME
mlmmj-unsub - unsubscribe address from a mailinglist run by mlmmj SYNOPSIS
mlmmj-unsub -L /path/to/list -a john@doe.org [-b] [-c | -C] [-d | -n | -N] [-h] [-q] [-r | -R] [-s] [-U] [-V] -a: Email address to unsubscribe -b: Behave as if unsubscription is due to bouncing (internal use) -c: Send goodbye mail -C: Request mail confirmation -d: Unsubscribe from the digest version of the list -h: This help -L: Full path to list directory -n: Unsubscribe from the nomail version of the list -N: Unsubscribe from the normal version of the list -q: Be quiet (don't notify owner about the unsubscribe) -r: Behave as if request arrived via email (internal use) -R: Behave as if confirmation arrived via email (internal use) -s: Don't send a mail to the address if not subscribed -U: Don't switch to the user id of the listdir owner -V: Print version DESCRIPTION
This utility is used to unsubscribe people from the specified mailinglist. It will remove the specified email address from every file in the <listdir>/subscribers.d/, <listdir>/digesters.d/ and <listdir>/nomailsubs.d/ directories (or if the -d, -n or -N switch is given, only the one relevant directory). Unless the -U switch is used it will switch its user id to the user id owning the list directory. This is done to make sure that new files created are having correct permissions. Normally a mail is sent to the person being unsubscribed if the address is not subscribed to the list. If the -s switch is used such a mail will not be sent. When neither -c nor -C is specified, unsubscription happens silently from the point of view of the subscriber. When -q is specified, unsub- scription happens silently from the point of view of the list owner. Use of -s is recommended to ensure you don't spam unsubscribed addresses by accident. SEE ALSO
mlmmj-sub(1) AUTHORS
This manual page was written by the following persons: Soren Boll Overgaard <boll@debian.org> (based on html2man output) Mads Martin Jorgensen <mmj@mmj.dk> mlmmj-unsub September 2004 mlmmj-unsub(1)
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy