Unix Shell Script to loop over Directory and send Filesname as parameters


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix Shell Script to loop over Directory and send Filesname as parameters
# 1  
Old 10-07-2009
Lightbulb Unix Shell Script to loop over Directory and send Filesname as parameters

Hi there
I'm new to UNIX scripting; I’m stuck with the following
I have an Oracle SQL script that takes three parameters
1- File Name
2- File Path
3- File creation date

Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need is a UNIX script that can do the following
Loop through Directory "/home/applmgr/snktmp"
Picks only files
Pass the file name to parameter &1
Pass the file path to parameter &2
Pass the file creation date to parameter &3

Call Oracle Script passing parameters &1,&2,&3
End loop

Is the above possible? I already knows how to call the Oracle Script from UNIX
I’m only stuck on writing the UNIX part where it List the files attribute(name,path,date) and store them to parameters ,Looping until the last file in the directory

If the above is not possible,then how can I create the below from the command line
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate

Thanks

Last edited by windjashi; 10-07-2009 at 06:17 PM..
# 2  
Old 10-07-2009
Quote:
Originally Posted by windjashi
Hi there

I'm new to UNIX scripting;

...and also new to posting in this (and perhaps any other) forum.

Please edit your post and remove all the FONT and COLOR tags. They make it very hard to see the content of your post when editing a reply.
# 3  
Old 10-07-2009
Oh i got it ,, didnt thought copying the text from MS WORD would do all that !! ..

thanks for the info

Last edited by windjashi; 10-07-2009 at 06:18 PM..
# 4  
Old 10-07-2009
Quote:
Originally Posted by windjashi
what do u mean ? i havent used any special font or coloring ? just wrote it on Word and past it here ?

Edit your previous post and you will see the mess that Word created.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Unable to send attachment with html tables in UNIX shell script

Heyy, any help would be grateful.... LOOKING FOR THE WAYS TO SEND AN EMAIL WITH ATTACHMENT & HTML TABLES IN BODY THROUGH SHELL SCRIPT (LINUX)..NOT SURE, IF WE HAVE ANY INBUILT HTML TAG OR UNIX COMMAND TO SEND THE ATTACHMENTS. KINDLY HELP below is small script posted for our understanding..... (2 Replies)
Discussion started by: Harsha Vardhan
2 Replies

2. Shell Programming and Scripting

Loop multiple directory, find a file and send email

Hello ALL, need a BASH script who find file and send email with attachment. I have 50 folders without sub directories in each generated files of different sizes but with a similar name Rp01.txt Rp02.txt Rp03.txt ...etc. Each directors bound by mail group, I need a script that goes as... (1 Reply)
Discussion started by: penchev
1 Replies

3. Shell Programming and Scripting

Script Send Mail by Parameters avec Attached file

Hi i have a script for show the information files. ls -l how do you for to place this result in a file of text and to send it attached for e-mail. The information of the mail must be in paramentros. for example e-mail to I must write the e-mail, the subject and the motive of the mail! ... (1 Reply)
Discussion started by: krlos07
1 Replies

4. Shell Programming and Scripting

How to send email once a day at certain time in unix shell script

hi, i have to send an email once a day at ceratin time say 22. i have tried with date commad, but not working.:( HOUROFTHEDAY=`date +'%H'` if ; then mailx -s "Info" emailid@org.com < $ProcessStatisticsFile fi Please help me... (5 Replies)
Discussion started by: sreelu
5 Replies

5. Shell Programming and Scripting

Shell script: If a file stays in a particular directory more than 30 min send an email

Hi , I am new to shell scripting. i have a requirement say i will receive a file in a directory say /xyz.if that file stays in that directory more than 30 min i need to get a mail to my outlook.this should run for every 20 min in crontab. can anyone help me? (8 Replies)
Discussion started by: muraliinfy04
8 Replies

6. Shell Programming and Scripting

Shell Script Passing Parameters For Directory Listing

i have this basic piece of code that i am trying to debug to accept input parameter to be able to display a directory listing of files. cd /u02/app/eatv/dev/out CURDIR=`pwd` echo directory listing of $CURDIR echo if ; then ls -latr else ls -latr $1 fi basically if the script... (9 Replies)
Discussion started by: wtolentino
9 Replies

7. Shell Programming and Scripting

shell script to send email with usage of space in the directory as description :

shell script to send email with usage of space in the directory as description : Please any one help me in writing a script to send email with usage of space in the directory as description . (3 Replies)
Discussion started by: sakthifire
3 Replies

8. Shell Programming and Scripting

help me in sending parameters from sqlplus script to unix shell script

Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files.. Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this? Please tell me... (2 Replies)
Discussion started by: Hara
2 Replies

9. UNIX for Advanced & Expert Users

Unix shell Script To Send SMS

hi , can anyone help with a script to send SMS to some mobile numbers on some conditions. (1 Reply)
Discussion started by: sdcoms
1 Replies

10. Shell Programming and Scripting

how to send parameters to script

hi all i have a script in c-shell call test that i want to send to him parameter name of directory to go to something like this the script : cd /usr/(here i want that he will go to the name of the directory that i send to him as a parameter) like :/usr/admin admin is the parameter the... (2 Replies)
Discussion started by: naamas03
2 Replies
Login or Register to Ask a Question