Sponsored Content
Full Discussion: Problems with Syntax
Top Forums Shell Programming and Scripting Problems with Syntax Post 302341397 by KenJackson on Wednesday 5th of August 2009 09:41:43 PM
Old 08-05-2009
I don't know what the r command does, but try this:
Code:
#!/bin/sh
file=directories.txt
days=100
while read line; do
    find $line -mtime +$days -exec r -f {} \; > errors.txt
    test -s errors.txt  &&  mail -s "errors" someone@email.com < errors.txt
done < $file

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

'make' problems (compliation problems?)

I'm trying to compile and install both most recent version of 'make' and the most recent version of 'openssh' on my Sparc20. I've run into the following problems... and I don't know what they mean. Can someone please help me resolve these issues? I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies

2. UNIX for Dummies Questions & Answers

What does this syntax mean...

OK, the title is a little vague, but basically i was gonig through some files and ran into some strange syntax... heres what it looks like: ... 1&>~/<file extension> where ... is a chain of commands (the 1&>~ is part of the arguments) and the file extension is just a pointer to a file... (1 Reply)
Discussion started by: DrAwesomePhD
1 Replies

3. Shell Programming and Scripting

Help with the syntax

export check=$(expandname $(dirname $(which $0))) (2 Replies)
Discussion started by: chandhar
2 Replies

4. Shell Programming and Scripting

Help with the syntax

can anyone explain the code for me... i am new to shell programming while getopts ":S:D:U:" OPTION "$@" do case $OPTION in S) SRVR=$OPTARG;; D) DB="$OPTARG"; USEDB="use $OPTARG";; U) UID=$OPTARG;; :) MISSINGOPTARG="$MISSINGOPTARG -$OPTARG";; ?) if then ... (2 Replies)
Discussion started by: chandhar
2 Replies

5. Shell Programming and Scripting

what is the right syntax ??

IN the book below example showed find /home/tolstoy -type d -print | Find all directories sed 's;/home/tolstoy/;/home/lt/;' | Change name, note use of semicolon delimiter while read newdir Read new directory name do mkdir $newdir ... (7 Replies)
Discussion started by: convenientstore
7 Replies

6. Shell Programming and Scripting

Regarding syntax

Hi All, What does this mean ${#var} (2 Replies)
Discussion started by: krishna_gnv
2 Replies

7. Shell Programming and Scripting

Problems with syntax in a loop (AWK)

Hi guys, I'm trying to loop through a number of files that is set by whatever is in a field. eg. The idea is to split FILELIST down into fields, it could contain 1 - 999 fields and it's bar delimited. I thought simple, count the number of fields in the field and then loop... (1 Reply)
Discussion started by: Peejay
1 Replies

8. UNIX for Dummies Questions & Answers

Syntax Help

Hi everyone, I got some code here that I've been working on, but I've gotten stuck. I cant figure out what is wrong with the syntax. sub cksum{ my $uint32_t = \buffer; my $word_count; my $bias; ( #uint32_t checksum = $bias $word_count = $bias while ($word_count>=0) ... (2 Replies)
Discussion started by: TeamUSA
2 Replies

9. Shell Programming and Scripting

Problems with variables syntax

Hi there I am really struggling :eek: to place a value in a variable with the following loop, having run out of ideas please can someone point me in the right direction? We first read two PIDs of a program (say calc) into an array, then we loop reading the details of those processes into a... (6 Replies)
Discussion started by: nathan.harris
6 Replies

10. Shell Programming and Scripting

EVAL syntax problems

Hi there As part of a larger script I need to put the output of an ls into a variable which has an incremental number. ie nathan@nathan-Vostro-1700:~$ eval 'proc'$val='`ls -ld /proc/9467`' nathan@nathan-Vostro-1700:~$ echo $proc0 dr-xr-xr-x 8 nathan nathan 0 2012-05-02 09:21... (3 Replies)
Discussion started by: nathan.harris
3 Replies
PHAR.EXTRACTTO(3)							 1							 PHAR.EXTRACTTO(3)

Phar::extractTo - Extract the contents of a phar archive to a directory

SYNOPSIS
public bool Phar::extractTo (string $pathto, [string|array $files], [bool $overwrite = false]) DESCRIPTION
Note This method requires the php.ini setting phar.readonly to be set to 0 in order to work for Phar objects. Otherwise, a PharException will be thrown. Extract all files within a phar archive to disk. Extracted files and directories preserve permissions as stored in the archive. The optional parameters allow optional control over which files are extracted, and whether existing files on disk can be overwritten. The sec- ond parameter files can be either the name of a file or directory to extract, or an array of names of files and directories to extract. By default, this method will not overwrite existing files, the third parameter can be set to true to enable overwriting of files. This method is similar to ZipArchive.extractTo(3). PARAMETERS
o $pathto - Path within an archive to the file to delete. o $files - The name of a file or directory to extract, or an array of files/directories to extract o $overwrite - Set to TRUE to enable overwriting existing files RETURN VALUES
returns TRUE on success, but it is better to check for thrown exception, and assume success if none is thrown. ERRORS
/EXCEPTIONS Throws PharException if errors occur while flushing changes to disk. EXAMPLES
Example #1 A Phar.extractTo(3) example <?php try { $phar = new Phar('myphar.phar'); $phar->extractTo('/full/path'); // extract all files $phar->extractTo('/another/path', 'file.txt'); // extract only file.txt $phar->extractTo('/this/path', array('file1.txt', 'file2.txt')); // extract 2 files only $phar->extractTo('/third/path', null, true); // extract all files, and overwrite } catch (Exception $e) { // handle errors } ?> SEE ALSO
PharData.extractTo(3). PHP Documentation Group PHAR.EXTRACTTO(3)
All times are GMT -4. The time now is 07:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy