Grrr. Well I tried
tail +3 $inFile > type1_temp
Result
No such file or directory
So I tried
touch touch type1_temp
tail +3 $inFile > type1_temp
Result
It shows the records on standard out (my screen) as they should look after the tail command, and makes the file type1_temp...
LOL. Cute how the case lets me do the match, and the if goes bonkers. Oh well, that got me through that =) Thanks!
Next lil glitch. I need to trim the top two lines off the file before I send it to my import procedure.
In my case I have
type1*)
tail +3 $inFile < $inFile+temp <--- this...
well, im close now.
this is what I have for now.
for inFile in $*
do
if [$infile = "type1*"] <--this does not work and is the sticking point atm--
then
calldb command
remove file
elif [.. = "type2*"]
...so on for all the file types
done
so what I need to do...
To clarify I am basically looking for some kind of logic like:
For each file in directory(
if type 1 then
run comannd(filename)
if type 2 then
run comannd(filename)
if type 3 then
run comannd(filename)
if type 4 then
run comannd(filename)
if type 5 then
run comannd(filename)
done...
Ok, I am fairly new at Unix scripting, but have been a programmer for years. I have a project I am spinning my wheels on right now.
Here is the job, I have a directory full of files. There are 5 types of files in this directory, all of them are tab delimited text files for a database. they...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.