Re: Enviro vars or files
From: Don Low (m_tessier_at_sympatico.ca)
Date: 10/13/03
- Next message: those who know me have no need of my name: "Re: yes UNIX | head -100 : how does it end ?"
- Previous message: Paul Victor Novarese: "Re: Working with colums"
- In reply to: Janis: "Re: Enviro vars or files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Oct 2003 14:50:59 GMT
Thank you for your feedback. I will go with the second way since these
variables will be used only by my one script, at least for now, and it's
easier to implement.
Don
In article <ecf2e4b7.0310130015.39d647f5@posting.google.com>, Janis wrote:
> Don Low <m_tessier@sympatico.ca> wrote in message news:<bmbs2p$kgc3r$1@ID-145503.news.uni-berlin.de>...
>> Hello,
>>
>> I'm in the midst of creating a bash script for uploading files. One of
>> the things this script must do is remember paths, email addresses and
>> domain names. To permanently store this info I could do one of two
>> things:
>>
>> 1. Put the info in different environment variables. Of course these
>> environment variables would be gone after logging out and back in, so I
>> would need to create files that store the information. Then these files
>> could be sourced by .bashrc and exported.
>>
>> 2. Store the info in files. When the script is rerun, it tests to see
>> if the files exist and then uses their content to carry out its
>> function.
>>
>> The second way seems easier to do, but I would like to ask someone's
>> opinion before proceeding. Maybe it's better to store the info in
>> environment variables. Maybe there's a third way of storing info that
>> may be better than the two ways I've suggested.
>>
>> If anyone has any comments on this matter, I'd like to hear from you.
>
> Your choice 1. is most likely considered easier, many do it that way.
> And it may be ok if you are just defining enviroment variables without
> side effects.
>
> On the other hand it is, IMO, an inherent insecure construct. Sourcing
> depends on the PATH and will directly affect your program environment.
> This is critical, if there is e.g. a 'cd' or similar code in the env file,
> or if the env file itself sources other env files.
>
> If you even feel that your solution 2. is simpler to implement I'd suggest
> to solve your task that way.
>
> Janis
- Next message: those who know me have no need of my name: "Re: yes UNIX | head -100 : how does it end ?"
- Previous message: Paul Victor Novarese: "Re: Working with colums"
- In reply to: Janis: "Re: Enviro vars or files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|