1) Which OS do you run ?
2) So you want your script to take 2 input arguments in format YYYYMMDD, and then, for every day in between these date, it check whether it can find an existing file with the concerned day in a directory that have a corresponding name, so the file should have the generic form :
./YYYYMMDD/<any_number>__*(text)_YYYYMMDD.txt file
???
Code:
$ ksh myd 20101117
file missing for date 20101117
file missing for date 20101118
file missing for date 20101119
file missing for date 20101120
file missing for date 20101121
file missing for date 20101122
$ mkdir 20101120
$ touch ./20101120/whatevername_20101120.txt
$ ksh myd 20101117
file missing for date 20101117
file missing for date 20101118
file missing for date 20101119
file missing for date 20101121
file missing for date 20101122
$
also handle leap year
Code:
$ ksh myd 19880226 19880302
file missing for date 19880226
file missing for date 19880227
file missing for date 19880228
file missing for date 19880229
file missing for date 19880301
file missing for date 19880302
$
Or here is a better version that includes runtime improvement :
Scanning from 20090101 to 20101122 came from :
Basically :
Code:
real 1m36.595s
user 0m12.428s
sys 0m48.939s
After adding just the single + 8870 iteration saving it decreased to :
Code:
real 0m27.938s
user 0m2.862s
sys 0m10.471s
And using built-in variable and +70 and +71 iteration saving we finally come to the runtime:
Code:
real 0m5.177s
user 0m1.083s
sys 0m3.152s
Here is the code (feel free to use and adapt to your needs)
For your information, i tested it on
I just want the output of this command to be stored in a variable like,
str = `grep Application.dbName serverdata/ServerProp.txt`
but while executing it says like,
str : startup 11: not found, where startup is the script name.
but while running the command alone like,
grep... (2 Replies)
hi friends,
i m tryin to load data from one set of table to other i have sql procedure al ready for it..!
i m going to load the procedure only if data in one of my table for example
table "landing " have 10 records each attribute of this table is
file_name status date ... (2 Replies)
The first step for you to create the script to change “JAVA_OPTS” variable definition as follows:
Original line:
JAVA_OPTS="-Dname=$JAVA_NAME -Xmx$JVM_MAX -DAGENT_HOME=$RT_HOME -DINSTALL_DIR=$RT_HOME -Djavax.net.ssl.keyStore=$RT_HOME/conf/client.keystore ... (3 Replies)
1.Display a list of /usr/share/doc subdirectories containing information about shells.How many README files do these subdirectories contain? Don't count anything in the form of "README.a_string".
2.Make a list of files in your home directory that were changed less that 10 hours ago, using grep,... (2 Replies)
i want use ssh on the host01 to execute autoexec.sh on the host02 like following :
host01> ssh host02 autoexec.sh
autoexec.sh include nohup command like follwing :
nohup /home/jack/deletedata.sh &
after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Hi all...
Please help me with this questions.
I am not good at shell scripting.
1) It seems like there are many ways that we can run the shell scripts.
what is the difference between each one?
i)./shell_script.sh
ii).(space)./ shell_script.sh
iii)sh shell_script.sh
... (3 Replies)
hey how u doing guys ... I'm a student @ EMU and taking a beginner Linux class and I have those two extra credit project that im struggling with so I hope to get some correction and help
write a shell script that will
1-prompt the user for a file name
2-check to see if the file exists... (2 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)