Sponsored Content
Top Forums Shell Programming and Scripting Basic While loop won't exit... Post 302384584 by trevthefatty on Tuesday 5th of January 2010 10:28:08 PM
Old 01-05-2010
Hey Scottn - I was playing with the -z option for test...just couldn't get it to work properly...thanks that works perfect! . ...
I'll keep working on my final project now that you got me past that...
what I am working on is a little motion detection system...I have the program 'motion' taking snapshots and saving them on the disk, I need the first one that is created to be emailed to me, since I am just using my webcam (built-in to laptop) - someone could just steal my laptop - so I need the first one to be emailed to myself....I know it sounds simple...but I'm working in a Camp in Northern Alberta Canada, and the cleaning staff here have been stealing etc....thanks again Scottn

Last edited by Scott; 01-05-2010 at 11:46 PM.. Reason: You're welcome, but too much info....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

while loop exit

i wrote a while script as part of a huge program. this script, once picked, begins to output data to the person using it. pretty easy, as the person doesn't have to keep typing commands to get the output that the while loop automatically throws out. now, the thing is, while this while-script... (3 Replies)
Discussion started by: Terrible
3 Replies

2. UNIX for Dummies Questions & Answers

A basic question of FOR loop

Hi, have a basic query. Please see the below code: list="one two three" for var in $list ; do echo $var list="nolist" Done Wht if I want to print only first/ last line in the list Eg one & three Regards er_ashu (3 Replies)
Discussion started by: er_ashu
3 Replies

3. Shell Programming and Scripting

really basic for loop question

sorry for being dumb here, but is there a way my for loop can take an entire line of a file into consideration instead of each word in a line... ill explain if i have a file like this # cat list serial: 23124 hostname: server1 and a script that does this # cat list.sh #!/bin/sh ... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

4. Shell Programming and Scripting

Null Handling in Until loop. . .loop won't stop

Hi Im running this script, which is supposed to find the max value build some tables and then stop running once all the tables are built. Thing is , it keeps assigning a null value to $h and then $g is null so it keep building tables i.e. testupdateNUL. How can I stop this? Here is what I have: ... (4 Replies)
Discussion started by: brandono66
4 Replies

5. Shell Programming and Scripting

Exit from loop

hi, how to exit from "if" loop?actually i have mutliple "if" conditions, i have to exit from each "if" loop,if it is true...:confused: Please suggest me... (3 Replies)
Discussion started by: sreelu
3 Replies

6. Emergency UNIX and Linux Support

For loop exit

Below for loop not exiting. Can someone help? JBOSS_INST_ARGS=01 02 if ; then for i in $JBOSS_INST_ARGS; do /u/jboss-6.1.0.Final/bin/jboss_init_wise$i.sh start; done (8 Replies)
Discussion started by: vino_hymi
8 Replies

7. Shell Programming and Scripting

Bash won't exit as expected

Hi there, following code snippet should output nothing, IMHO. But the result is "THE END". #!/bin/bash if true ; thenexit fi | grep "somesearchstring" echo "THE END"using bash 4.1.9(1) Bug or feature? Hagen (5 Replies)
Discussion started by: montour
5 Replies

8. Shell Programming and Scripting

Trying to run a basic for loop

OS : RHEL 6.1 Shell : Bash I had a similair post on this a few weeks back. But I didn't explain my requirements clearly then. Hence starting a new thread now. I have lots of files in /tmp/stage directory as show below. I want to loop through each files to run a command on each file. I... (8 Replies)
Discussion started by: kraljic
8 Replies

9. Shell Programming and Scripting

Basic help improving for in loop

I'm obviously very new to this. I'm trying to write a simple for loop that will read the directory names in /Users and then copy a file into the same subdir in each user directory. I have this, and it works but it isn't great. #!/bin/bash HOMEDIRS=/Users/* for dirs in $HOMEDIRS; do if ];... (5 Replies)
Discussion started by: Heath_T
5 Replies

10. Shell Programming and Scripting

Basic FOR loop with break

Oracle Linux : 6.4/bash shell In the below I want to break out of the loop when it enters the 5th iteration. #!/bin/bash for i in 1 2 3 4 5 6 do echo "$i" if echo "Oh Nooo... i = $i. I need to stop the iteration and jump out of the loop" then break fi done But, it only... (3 Replies)
Discussion started by: John K
3 Replies
CHANGETRACK(1)						      General Commands Manual						    CHANGETRACK(1)

NAME
changetrack - track changes to files SYNOPSIS
changetrack [-h] [-c configfile] [-d directory] [-e] [-r] [-q] [-m message] [-M message] [-v] [-u] [-o toaddress] [-f fromaddress] DESCRIPTION
changetrack is a program to monitor changes to a bunch of files. If files are modified one day, and the machine starts working incorrectly some days later, changetrack can provide information on which files were modified, and help locate the problem. Normally changetrack uses ed to keep track of various revisions of the files by maintaining an .ed script with the change history for each file. Alternatively, changetrack can use rcs to keep track of various revisions of the files. Each file is "installed" in the rcs system the first time that changetrack is run after that file is added to the config file. Whenever changetrack is run after that, a copy of the file is made, which is 'checked in' and implicitly 'checked out' of the rcs system. See the man page of co for information on retrieving an old version of the file. Backup files (ending in tilde ~) are ignored, unless explicitely included. After each pattern in the file list, adding white space, a colon (:) then more whitespace, followed by email addresses, separated by more whitespace, will result in the changes to that file being emailed to that address. All changes from each run are expressed in one email. Using the email feature requires Mail::SendMail to be installed; if it does not work correctly, an error message will be printed to stan- dard error. OPTIONS
-h Display a short help message then exit. -cconfigfile Get the list of files to track from configfile instead of from ~/.changetrackrc (/etc/changetrack.conf for the super-user) -doutputdirectory Store output in outputdirectory instead of in ~/.changetrack/ (/var/lib/changetrack/ for the super-user) -e Keep a copy of the file from when it was first added to the changetrack configuration, and keep ed -styled changes to rebuild the file. This option is recommended only if rcs does not work on the machine. To recover using this means, the .ed file should have the last several commands removed, to allow the file to be rebuilt to the appropriate state. A command like 'cat myfile.ed | ed myfile.original' should be executed. -r Disable the rcs facility. -q Quiet mode; only print critical messages. Good for scripts. -mmessage Print message on each file, after checking for any changes. Good for indicating reboots or other system events. -Mmessage Like -m, but message is only printed on modified files. -v Print version and exit. -u Use unified diffs (this only works with some implementations of diff. -oemailaddress Mail output to emailaddress. This is supplementary to emails specified in the config file. -femailaddress Set "From" header to emailaddress, which must be fully qualified. REQUIREMENTS
This program requires diff. Unless the -r switch is used, this program requires rcs to be installed. If the -e switch is used, ed is required. FILES
~/.changetrackrc List of files to monitor. Each line may start with '#' indicating a comment. If a line is not a comment, it contains a file/pattern to monitor, and optionally " : " followed by any email addresses to send changes to. The filename may be a pattern described in the same way as for ls. Note: the default is /etc/changetrack.conf for root. ~/.changetrack/ Default directory in which to store output information. The default is /var/lib/changetrack/ for root. All rcs files are stored in this directory, unless a subdirectory called RCS exists, in which case the rcs files are stored in that directory. /etc/cron.daily/changetrack Script that creates the list of all files monitor. /etc/cron.hourly/changetrack Script that invocates changetrack. /etc/default/changetrack Configuration for the above two scripts. DIAGNOSTICS
Each filename is written to standard output. rcs will print errors if certain things go wrong. It will also print a few lines each time changetrack is run after a new file is added to the configuration. IDENTIFICATION
Author: Cameron J. Morland. Manual Page Revision: 2.1 Release Date: 2001-03-06. Copyright (C) 2001-2005 Cameron J. Morland. Changed by Jens Peter Secher to reflect the Debian modifications. SEE ALSO
ed(1), rcsintro(1), co(1) TODO
Automate removal of out-of-date changes, to save disk space and clarify the important changes. BUGS
None known. CHANGETRACK(1)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy