i wanna make the output file to be named automatically by date for example
Code:
22112011.txt or 12011.txt
23112011.txt or 22011.txt
and i wanna make it runs automatically every day at 10 am
[ each day at 10 am ./test.sh ]
and to put its input automatically by making a script to search in the given directory for the files starts with BMW and ends with .txt [ take care make it to rename files . processing and .done ] to prevent that file it taken twice
finally: a scripts search certain source files and runs every day at 10 am and all ouput in a file named by date thanks alot waiting your brilliant replies
i don;t know if I fully understood your last question, but you could think about using hour, date and time in the output files in order to differentiate the filenames among different executions of the script in the same day.
ok vor this part for output
i want my input files to be taken from a certain path ( all starts with IBM and end .txt )
and take them by order without overwriting (taken twice ) . is it ok now ?
ok,
so you could just use a for cicle to call your script, like:
Code:
for sourcefile in `ls /mo/omar/teefa/filesDBM/IBM*.txt` ; do /path/to/test.sh $sourcefile 2nd_param 3rd_param ; done
The shell will expand the
Code:
`ls /mo/omar/teefa/filesDBM/IBM*.txt`
by returning all the filenames contained in the path.
Be aware: the ls commend will return both files and subdirectories as well as links contained in /mo/omar/teefa/filesDBM, so if you want only filenames returned, use the find command instead (see man find with particular reference to the -t, -name and -print options).
Obviously, you can use the `date` trick to obtain output filenames based on dates.
You can use the previous one-liner right in the crontab.
see ya
fra
P.S.
please be also aware of the -maxdepth option in find (it limits the scope to the directory passed as argument, thereby avoiding subdirectory recursion).
Finally, ls without other time-related switches guarantees that filenames are returned in alphabetical order (by the way, digits are actually considered strings); I'm not sure that the -name switch of find does the same.
Last edited by frappa; 11-28-2011 at 04:52 PM..
Reason: added some further additional clarification
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)