![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BASH condition for "File older than 1 hour" | Squeakygoose | Shell Programming and Scripting | 2 | 02-16-2009 03:06 PM |
| The "PS" command was displaying*terminals named as "SYSCON" | kiranjose85 | UNIX for Advanced & Expert Users | 1 | 11-28-2008 07:53 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 01:52 AM |
| bash: cd command to access "strange" directories | robotronic | Shell Programming and Scripting | 3 | 07-06-2007 05:35 PM |
| Unix "at" / "Cron" Command New Problem...Need help | Mohanraj | UNIX for Dummies Questions & Answers | 3 | 01-26-2006 08:08 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi.
I have the script shown below. If I execute it form the command line it seems to work properly, but when I fun it using the unix "at" command "at -m now < ./kill-at-job.sh" It appears to hang. Below is the script, the input file, and the execution as reported in the e-mail from the "at" processor. This is running on sunOS, version 5.8. Thanks ! Joe Simon The script : #!/bin/bash # set -x # Get Info from : # ~/builds/scripts/at-job.log # AT_LOG_FILE_NAME=~/builds/scripts/at-job.log LINE_COUNT=0 while read LINE do # Need to skip first line, at job name is on 2nd line if [[ $LINE_COUNT -eq 1 ]] ; then set -- $LINE AT_JOB="$2" echo "AT Job ID = $AT_JOB" break fi LINE_COUNT=$(($LINE_COUNT+1)) done < $AT_LOG_FILE_NAME echo "Loop Complete" The input file looks like this: commands will be executed using /bin/bash job 1237304740.a at Tue Mar 17 11:45:40 2009 The log file e-mailed to me looks like this: Your "at" job on xxxx "/var/spool/cron/atjobs/1237303896.a" produced the following output: + AT_LOG_FILE_NAME=/xxx/builds/scripts/at-job.log + LINE_COUNT=0 + read LINE + [[ 0 -eq 1 ]] + LINE_COUNT=1 + read LINE + [[ 1 -eq 1 ]] + set -- job 1237304740.a at Tue Mar 17 11:45:40 2009 + AT_JOB=1237304740.a + echo 'AT Job ID = 1237304740.a' AT Job ID = 1237304740.a + break If I remove the break (this is what I originally had), the execution looks like this: + AT_LOG_FILE_NAME=/export/home4/a10/simonj/builds/scripts/at-job.log + LINE_COUNT=0 + read LINE + [[ 0 -eq 1 ]] + LINE_COUNT=1 + read LINE + [[ 1 -eq 1 ]] + set -- job 1237304740.a at Tue Mar 17 11:45:40 2009 + AT_JOB=1237304740.a + echo 'AT Job ID = 1237304740.a' AT Job ID = 1237304740.a + LINE_COUNT=2 + read LINE |
|
||||
|
Yes " The input file looks like this: commands will be executed using /bin/bash job 1237304740.a at Tue Mar 17 11:45:40 2009" and you can see in the execution "+ echo 'AT Job ID = 1237304740.a' AT Job ID = 1237304740.a" So it is reading the file, but getting stuck I don't unnerstand it. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|