[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: script problem

> -----Original Message-----
> From: m roth2006 rcn com [mailto:m roth2006 rcn com]
> Sent: Thursday, December 13, 2007 1:22 PM
> To: Steven Buehler
> Subject: RE: script problem
> >Date: Thu, 13 Dec 2007 13:15:40 -0600
> >From: "Steven Buehler" <steve ibushost com>
> >
> >Never mind.  A quick search showed me how to do that too.  Thank you
> for
> >your help.
> No problem. I was thinking of a way to do it in shell - maybe
> while
>    $NUM=$NUM+!
>    bu_fil=`awk -v RNUM=$NUM conf.file`
>    tar -cvf ${bu_fil}.tar $bu_fil
> wend
> The perl just seemed the easier tool. As they said, years back in
> SysAdmin, perl: the sysadmin's Swiss Army chainsaw. <g>
>     mark

I agree that perl is more powerful.  I might convert some day when I have
more time.  To add the config file to my shell script, at the top of the
file I just have:
. backup.cfg

That will load it in at the top of my script.  The only problem is that the
script then has to run from the same directory as the config file.  Unless
that line is edited to show the exact location of the cfg file.  But if I do
that, then it defeats the purpose of a config file so people would stay out
of the script file.  I tried running the file from the root directory like
/bin/sh /root/backups/backup.sh
But if I have the include line like I do above, it tries finding the file in
the directory that I am in, not the directory that the script is in.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]