If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > return verable's contents as a verable. How?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-03, 10:19
EZEE! EZEE! is offline
Registered User
 
Join Date: Oct 2003
Location: East Coast of South Africa
Posts: 10
return verable's contents as a verable. How?

Hello all,
Scenario: bash, #of days in year into verable and I want to use in find.

Sample:
#!/bin/bash
three=`date '+%j'`
two=`expr $three + 365`
one=`expr $two + 365`

todir='/usrdata/history/working'

for i in $(echo one two three)
do
out="outfile$i"
touch $out
find /usr4/daten -mtime +$("$i") >>$out
while read bla
do
echo $bla
#more command here for moving data
done < $out
done

Fault: the -mtime should read -mtime +"value for each verable"

How do I do this pleeeezz.

Last edited by EZEE!; 10-16-03 at 10:22.
Reply With Quote
  #2 (permalink)  
Old 10-17-03, 02:53
karthi_tvr karthi_tvr is offline
Registered User
 
Join Date: Oct 2003
Location: Singapore
Posts: 12
Do a
for i in $one $two $three
instead of
for i in $(echo one two three)
__________________
Thanks and Regards
Karthik R
Reply With Quote
  #3 (permalink)  
Old 10-24-03, 08:22
EZEE! EZEE! is offline
Registered User
 
Join Date: Oct 2003
Location: East Coast of South Africa
Posts: 10
Not altogether there yet!

Further along... the road.


I am looking at using the verable name as a filename and the contents of the verable as the find criteria.
IE, lets say the verable 'three' contains the value 2554

I want the result >> into a file called 'three'
and the find command mist use -mtime +2554

so:
find . -mtime2554 > three.txt is what I want
and this is similar to how I want to get it abut I know there are errors.


one='expr 3333'
two='expr 3000'
three='expr 2554'

for i in $(echo one two three)
do
find . -mtime$i > $i.txt
done

Any ideas without having to use case.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On