Re: Files not found
- From: John <nyrinwi@xxxxxxxxx>
- Date: Sun, 09 Mar 2008 14:08:37 -0500
Leslie Rhorer wrote:
"John" <nyrinwi@xxxxxxxxx> wrote in message news:47d2a3e5$0$4968$4c368faf@xxxxxxxxxxxxxxxxxSounds like your cron job is running with strict Bourne shell compatibility, so you're not getting Bash extensions.files=$(find ./ -cmin -5 -print)
or if you prefer an array...
files=($(find ./ -cmin -5 -print))
You can then take whatever action you like; e.g.
if [ ${#files} -eq 0 ]; then ... # non array
I tried this, and it doesn't work, either. It gives me an error, saying:
./Videoscribe: line 23: unexpected EOF while looking for matching `)'
Line 23 is the if [ ${#files} -eq 0 ] statement.
Then it says:
./Videoscribe: line 33: syntax error: unexpected end of file
The script Videoscribe only has 32 lines.
If I remove the if [ ${#files} -eq 0 ]; then ... fi section, the errors disappear.
Other than as a comment delimiter, I am not familiar with the use of # within an evaluation expression. What does it do?
${#var} gives the length of a variable in chars. It's a Bash feature.
${#var[@]} gives the length of an array - also a Bash feature.
Make sure your script begins with #!/bin/sh, or #!/bin/bash
John
.
- Follow-Ups:
- Re: Files not found
- From: Leslie Rhorer
- Re: Files not found
- From: Leslie Rhorer
- Re: Files not found
- References:
- Files not found
- From: Leslie Rhorer
- Re: Files not found
- From: John
- Re: Files not found
- From: Leslie Rhorer
- Files not found
- Prev by Date: Re: Regenerating the configure script of a stripped down package
- Next by Date: Re: Does Linux have a help file SDK
- Previous by thread: Re: Files not found
- Next by thread: Re: Files not found
- Index(es):