Sponsored Content
Top Forums Shell Programming and Scripting Getting all the files modified today & store the names in a variable as , separated Post 302310764 by ananthi_ku on Monday 27th of April 2009 02:12:54 AM
Old 04-27-2009
Hi all,

I am facing another issue with this find.....

Here is my program



#!/bin/sh
# Environmental set up
envSet="true";

# Initialize error code
error_code="false";

if [ "$envSet" = "$2" ]
then
# Set batch environment
. $1/jobs/setBatchEnv.sh $1
fi

echo "file name ---------"$filename
echo "BATCH_HOME ---------"$BATCH_HOME
echo "3 ---------"$3

#Frame the output file name
if [ "$filename" != "" ]
then
echo "Inside IF"
#if ZipReports.sh executed, then the filename of the zip will be taken from that
outfilename = $filename;
else
echo "Inside ELSE"
#if ZipReports.sh not executed, then the filename will be the list of files that are last modified today
cd $BATCH_HOME/data/output/$3
pwd
outfilename=$(find . -type f -mtime 0 | tr '\n' ',');
fi

echo "outifle-------"$outfilename

# Call the EmailReportsBatch.java program
$JAVA_HOME/java -Xmx1024m -Djava.awt.headless=true \
-DPROPERTIES_PATH=$BATCH_HOME/properties \
-DREPORT_TYPE=$3 \
-DOUTPUT_PATH=$BATCH_HOME/data/output/$3/ \
-DOUTPUT_FILE=$outfilename \
batch.EmailReportsBatch > $LOG_DIR/EmailReportsBatch.log

# Check if java command fails
if test ! $? -eq 0
then
error_code="true";
fi




When i execute this pgm i am getting the outfilename value correctly. But when it is invoked from main shell this outfilename is giving me one value less than what it is supposed to give. That is if 3 files are modified today, it is giving only 2 file names. Any suggestion why this is happening?Smilie But when BATCH_HOME, $3 values are echoed they show the same results...


Thanks,
Ananthi.U
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find today's files & send to another server?

Hi All, My script has to find todays modified( less than 24 hrs) files & send it another server using SCP. what I wrote is find . -type f -mtime -1 | xargs ls -ltr ## to find today's files, but its giving my sh_history file also, I don't require this file at all. scp... (4 Replies)
Discussion started by: zinu
4 Replies

2. Shell Programming and Scripting

List Files & Folders created/modified

Hello people, I want to list the files & folders created/modified since a particular date say June 2006. I know I can list recursively thru the folders and use awk to extract the date column to get the desired output. Just wanted to check whether there is an easier way to do this. Please... (2 Replies)
Discussion started by: tipsy
2 Replies

3. UNIX for Advanced & Expert Users

Find and store files based on FileName and Modified Time

Hi, I am currently using the following command: files=(ls enuCPU??.????.exp ntuCPU??.????.exp) I need to now change the commmand to store the file names of files that have been modified before datetime equal to say '02/16/2008 20:30:00' What could I use? (2 Replies)
Discussion started by: edisonantus
2 Replies

4. Shell Programming and Scripting

Getting modified time & filename only

Hi, When we use "ls -l" we are getting like below, -rw-r--r-- 1 mdskl mds 4161479 Apr 12 14:57 VTTF2008.20080412145748.cc But i need only modified time and filename only like below, Apr 12 14:57 VTTF3008.20080412145748.cc Thanks-:) Senthil (4 Replies)
Discussion started by: senthil_seera
4 Replies

5. Shell Programming and Scripting

Find files older then today & display with timestamp info

Small query- I want to do some operation on all the files older then today. Before I do that operation, i want to verify if the command works properly or not. Surprisingly, the command below returns me file, which are created today - find /mrk_archive/PG/ftp/incomming/gbs/2008 -type f... (2 Replies)
Discussion started by: kedar.mehta
2 Replies

6. Shell Programming and Scripting

script to store comma separated values in different variables

Hello friends, I need ur help.I want to write a script. The script should read contents from a file namely xyz. e.g xyz abcd,1234,efgh,7854378 dhnsa,dsakjkdl,43432,ZXDsa the script should store comma (,) seperated values in different variables. Once pointer will reach end of line (\n), it should... (1 Reply)
Discussion started by: akhtar.bhat
1 Replies

7. Shell Programming and Scripting

Parse text file in shell & store to variable

Hi, I need to parse a simple text file like below and store the word that starts with BR* to a variable say $BRno. I need to do this in sh script. NOTE: the length of the numbers following BR is in constant. And there is only 1 BRXXX in a file at a given time. .txt file: BR276828... (1 Reply)
Discussion started by: script2010
1 Replies

8. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

9. Shell Programming and Scripting

How to store files names from a directory to an array

Hi I want to store the file names into an array. I have written like this but I am getting error. declare -A arr_Filenames ls -l *.log | set -A arr_Filenames $(awk '{print $9}') index=0 while (( $index < ${#arr_Filenames })); do Current_Filename=${arr_Filenames} ... (5 Replies)
Discussion started by: dgmm
5 Replies

10. Shell Programming and Scripting

How to replace & with and in tab separated file?

Hi, I have a tab separated. I want to replace all the "&" in 8th column of the file with "and" .I am trying with awk -F, -vOFS=\\t '{$8=($8=="&")?"and":$8}1' test> test1.txt My file is abc def ghk hjk lkm hgb jkluy acvf & bhj hihuhu fgg me mine he her go went has has & had hgf hgy ... (1 Reply)
Discussion started by: jagdishrout
1 Replies
OPENSSL_PKCS7_VERIFY(3) 						 1						   OPENSSL_PKCS7_VERIFY(3)

openssl_pkcs7_verify - Verifies the signature of an S/MIME signed message

SYNOPSIS
mixed openssl_pkcs7_verify (string $filename, int $flags, [string $outfilename], [array $cainfo], [string $extracerts], [string $con- tent]) DESCRIPTION
openssl_pkcs7_verify(3) reads the S/MIME message contained in the given file and examines the digital signature. PARAMETERS
o $filename - Path to the message. o $flags -$flags can be used to affect how the signature is verified - see PKCS7 constants for more information. o $outfilename - If the $outfilename is specified, it should be a string holding the name of a file into which the certificates of the persons that signed the messages will be stored in PEM format. o $cainfo - If the $cainfo is specified, it should hold information about the trusted CA certificates to use in the verification process - see certificate verification for more information about this parameter. o $extracerts - If the $extracerts is specified, it is the filename of a file containing a bunch of certificates to use as untrusted CAs. o $content - You can specify a filename with $content that will be filled with the verified data, but with the signature information stripped. RETURN VALUES
Returns TRUE if the signature is verified, FALSE if it is not correct (the message has been tampered with, or the signing certificate is invalid), or -1 on error. CHANGELOG
+--------+------------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------------+ | 5.1.0 | | | | | | | The $content parameter was added. | | | | +--------+------------------------------------+ NOTES
Note As specified in RFC 2045, lines may not be longer than 76 characters in the $filename parameter. PHP Documentation Group OPENSSL_PKCS7_VERIFY(3)
All times are GMT -4. The time now is 10:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy