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

Re: .ini files in bash?



Once upon a time Miquel van Smoorenburg said...
> In article <[🔎] 200411290924.30130.d_baron@012.net.il>,
> David Baron  <d_baron@012.net.il> wrote:
> >How might one save and restore setting of variables in a bash script to and 
> >from a file in one's home (or sub-) directory?
> 
> Okay so everybody's trying to outdo eachother trying to write
> sed scripts that do proper quoting. 

No, that's just me outdoing myself (or really just finding cases that my
last attempt failed on).

> To save variables:
> 
> 	export -p > envfile
> 
> To read them back:
> 
> 	. envfile

An equivalent suggestion has already been raised and rejected. The
original poster did not want to save all variables, just certain ones.
Plus, this method will not allow you to save non-exported shell
variables.



Reply to: