Sponsored Content
Top Forums Shell Programming and Scripting Unix Shell Script to loop over Directory and send Filesname as parameters Post 302359864 by windjashi on Wednesday 7th of October 2009 03:15:44 PM
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..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
inc::Module::Install::DSL(3pm)				User Contributed Perl Documentation			    inc::Module::Install::DSL(3pm)

NAME
inc::Module::Install::DSL - Domain Specific Language for Module::Install SYNOPSIS
use inc::Module::Install::DSL 0.80; all_from lib/ADAMK/Repository.pm requires File::Spec 3.29 requires File::pushd 1.00 requires File::Find::Rule 0.30 requires File::Find::Rule::VCS 1.05 requires File::Flat 0 requires File::Remove 1.42 requires IPC::Run3 0.034 requires Object::Tiny 1.06 requires Params::Util 0.35 requires CPAN::Version 5.5 test_requires Test::More 0.86 test_requires Test::Script 1.03 install_script adamk requires_external_bin svn DESCRIPTION
One of the primary design goals of Module::Install is to simplify the creation of Makefile.PL scripts. Part of this involves the gradual reduction of any and all superfluous characters, with the ultimate goal of requiring no non-critical information in the file. Module::Install::DSL is a simple Domain Specific Language based on the already-lightweight Module::Install command syntax. The DSL takes one command on each line, and then wraps the command (and its parameters) with the normal quotes and semi-colons etc to turn it into Perl code. SUPPORT
Bugs should be reported via the CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install> For other issues contact the author. AUTHORS
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2008 - 2012 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-01 inc::Module::Install::DSL(3pm)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy