need a shell script to extract the files from source file and check whether those files existonserve
Hi,
I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is
My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether those files exist on the solaris server and if so what is the location they are present.could somebody help on this?
---------- Post updated at 07:43 AM ---------- Previous update was at 06:53 AM ----------
i have used folllowin command to extract files from the source file.
i am able to direct the out put to srclst file.Now searching command to find the file from teh srclist file and need to check where that file is located on the server
Last edited by Franklin52; 02-22-2012 at 06:00 AM..
Reason: Please use code tags for code and data samples, thank you
hi,
Thanks for u r reply.It's giving trouble with grep -E option.
output of the command:
I have removed -E and ran the script with grep -li.not sure what is the impact of chnanging it.
i will explain the requirement in a very clear manner.
1)I have source file named makefile.i am grepping some extention files like .c,.cxx etc from it and moving the output to a filename srctxt.
2)then i need to check whatever files present in srctxt are present in server.say if i have file.c in srctxt file i need to check the file exist on server
find / - name file.c -print.
3)ultimate goal is if i whatever file present in srctxt file say file.c if not present in solaris serve i need to findout that files and need to get that from external vendor.so need to run a loop for finding the file and if i didnot find the file then need send a error like file doesnot exist.
once again thanks verymuch for u r reply.
Last edited by Franklin52; 02-22-2012 at 06:00 AM..
Reason: Please use code tags for code and data samples, thank you
thanks for the reply.i have modified the grep to /usr/xpg4/bin/grep and option E is working with it.But after running it scritpt not coming out.
output after running script:
what can be done now?
Last edited by Franklin52; 02-22-2012 at 06:01 AM..
Reason: Code tags
Hello,
I needed help with a shell script where in it checks if a file exists under a directory and also checks the age of the file and delete it if it is older than 3 weeks.
thanks (10 Replies)
Hi,
I am trying to write a script for following scenario:
I have a list of countries from where I receive files...eg. (Indonesia, Thailand, Australia...etc)
For each country, I have a list of files that they send.
IND -- a,b,c
TH -- p,q,r
AU -- x,y,z
The path for these files could... (2 Replies)
Hi there,
I'm a newbie in unix and am fishing for options related to how raw input data files are handled. The scenario, as I'm sure y'all must be very familiar with, is this : we receive upwards of 50 data files in ASCII format from various source systems - now each file has its own structure... (3 Replies)
hi,
I am having script in which i want to check if directory has any file in it or not. If directory contains a single or more files then and only then it should proceed to further operations...
P.S.: Directory might have thousand number of files. so there might be chance of getting error... (4 Replies)
Hi All,
Thanks in Advance
I wrote the following code
if
then
echo "version is 1.1"
for i in "subscriber promplan mapping dedicatedaccount faflistSub faflistAcc accumulator pam_account"
do
FILE="SDP_DUMP_$i.csv"
echo "$FILE"
... (5 Replies)
HI all,
I want to script where all the server names will be in a text file like
server1
server2
server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
I'm new to shell scripting... i have been given a task.. can any one help in this regard....
1) Check hourly for files in <destination-path><destination-file-template><destination-file-suffix> for files older than <destination-file-retention> days and purge. It should then check... (1 Reply)
Hi friends..
I hav a problem....
I dont know how to check .c files exists r not in a folder using IF in C shell script
actually i tried like this
if(=~ *.c)
even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
I need to write a shell script to transfer the files every hour from source - target server.
The cron job should be running every hour and shouldn't copy already copied files to the remote server ?
I was able to write intial script but not able to get the logic for (in the next run it should... (12 Replies)