Should be more like this: readCan take parameters itself which are separated by blank(s) (Defined through IFS in the shell). So awk is not needed here to fill the variables.
I am not sure what is the difference between those 2 files tar_config2 and /home/499633/scripts/tar_config_file.sh though.
To make a dry run you could add a echo in front of the find command (maybe add some escapes to avoid errors).
Hi Zaxxon,
well Sorry there is only one file tar_config2.sh which contain the configuration details ...below are the details
Quote:
10 /home/499633/files /home/499633/output
so if I try your code as guided by you
Quote:
#!/bin/sh
while read DAYS INDIR OUTDIR
do
find $INDIR -type f "!" -mtime $DAYS -exec mv {} $OUTDIR \;
done < tar_config2
Just to not mess up each post, you do not have to quote every former post. That is not needed as we can see and read them actually and don't need a copy inside your new posts.
Also for code, use code tags, not quotes. Quotes are just for quoting somebody. When you write code, then use code tags like [code] for the beginning and [/code] to end the code, data or logs, thanks.
Also you can try out the code we handed over. You can also just set up some dummy directory with files to test the code, as well as you can add an echo in front of the actual find command, so nothing harmful will happen.
Yes it will.. Modified input file to while loop ..
Hi Jayan,
thanks a lot ,well I have a folder named scripts(\home\Administrator\scripts) in which all files(tar_config-file1.sh and main1.sh ) are kept. so now main1.sh wil read the properties from tar_config-file.sh and as per that it will do the logic ...and there is input folder from where the files will be selected and the output folder where the files will be moved
the contents of the tar_config_file1.sh are
*********************************
the contents of the main1.sh are
******************************
Now upon executing main1.sh, I get the error that
main1.sh syntax error near unexpected token 'done'.please guide me how to corret this problem
Hi Experts,
I have a script as below :
# cat a.sh
var=`mysql -usupport -p'testing' -e "select count(1) from db_test.sampletable;"`
echo $var
the output of this script is :
count(1) 145039
Now i want to remove header from my o/p and modify somewhat like
145039
I have... (9 Replies)
Hi,
I am looking for a shell script which serves the below purpose.
Please find below the algorithm for the same and any help on this would be highly appreciated.
1)set of strings need to be replaced among set of files(directory may contain different types of files)
2)It should search for... (10 Replies)
Hi All
I had installed sudo in HP UX 11.3 and it is working fine but not able to make entry required to set permission similar to ROOT without using password (PASSWD) change option for define user in /etc/sudoers file
Please help if some know the syntex? :confused::wall: (2 Replies)
Hey All,
I am seeking for the script which will do as follows,
1) Login on one Unix server "Server1"
2) Want to access other Unix server "Server2", and want to get the information as, on one go.
df -k /tmp
df -k /
df -k "any file system"
3) Re-direct the output to "space.txt" on... (12 Replies)
Hi Experts,
I am very beginner in Bash Shell Scripting. Can anyone please guide me to create a script which should show the most busy file systems in sort basis as there are a lot of file systems on the server.
I was told this task to be done by my IT lead and I must have to do this in... (3 Replies)
My data is something like shown below.
date1 date2 aaa bbbb ccccc
date3 date4 dddd eeeeeee ffffffffff ggggg hh
I want the output like this
date1date2 aaa eeeeee
I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Hi All,
I have file nodes.txt that contains node names one by one.
I'm running the following command.
/opt/OV/bin/ovet_topodump.ovpl -nodeif <nodename> -detail
Field <nodename> should take (replace) the node names from the nodes.txt one by one till last node.
Pls. give me script for... (1 Reply)