Re: Problem with quotes I think in the command

From: <lukas_at_aiken.cz>
Date: Wed, 10 Sep 2008 13:08:07 +0200

Prepend each space by a backslash instead of quoting the string. This
should work and is described in the FAQ. But your problem has another
kind. "echo" is probably a shell command, not a program. incron has no
chance how to identify shell commands and pass them into the appropriate
shell. And additionaly, incron can't handle multiple (piped) commands.
Please write a shell script and place your commands into it. For example
- your script may be like this (I'm not good at shell scripts, it may
contains bugs):

-- begin of example --
#!/bin/sh
echo "$1 Has been uploaded to the ftp drop box" | /usr/bin/mail -s
NewFile test_at_example.com
-- end of example --

And your incron rule will be like this (considering the script is
/usr/local/bin/myscript):

-- begin of example --
/home/ftp/upload IN_CLOSE_WRITE /usr/local/bin/myscript $#
-- end of example --

Lukas

> This does not work, does anyone know why, or can anyone tell me how to
> do this command
>
> /home/ftp/upload/ IN_CLOSE_WRITE echo "$# Has been uploaded to the ftp
> drop box" | /usr/bin/mail -s NewFile test_at_example.com
>
>
Received on Wed Sep 10 2008 - 13:08:33 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST