Re: .ini files in bash?
From: Cameron Hutchison (camh+dl_at_xdna.net)
Date: 11/29/04
- Previous message: Andrew M.A. Cater: "Re: Full replacement of MS"
- In reply to: David Baron: "Re: .ini files in bash?"
- Next in thread: Nate Bargmann: "Re: .ini files in bash?"
- Reply: Nate Bargmann: "Re: .ini files in bash?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Nov 2004 08:11:54 +1100 To: debian-user@lists.debian.org
Once upon a time David Baron said...
> On Monday 29 November 2004 16:04, Sam Watkins wrote:
> > If you want to see what variables are set, type:
> >
> > set
> >
> > this shows shell functions too.
> >
> > you can save these variables (and possibly functions) in a file:
> >
> > set > myvariables
> >
> > and restore them again:
> >
> > source ./myvariables
> >
> > or if you're lazy to type source:
> >
> > . ./myvariables
>
> set > myvariables does through every (I mean everything) somehow set in
> ~/myvariables.
>
> However, source ~/myvariables does NOT work. Script simply aborts. It is
> finding the file, otherwize, get error message.
Ok. I got bored and spend a minute writing this:
function savevars()
{
for var in "$@" ; do
eval "echo $var=\\\"\$$var\\\""
done
}
Just call it like:
savevars VAR1 VAR2 VAR3 >file
then load the vars with:
source ./file
-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Andrew M.A. Cater: "Re: Full replacement of MS"
- In reply to: David Baron: "Re: .ini files in bash?"
- Next in thread: Nate Bargmann: "Re: .ini files in bash?"
- Reply: Nate Bargmann: "Re: .ini files in bash?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|