Re: Enviro vars or files

From: Don Low (m_tessier_at_sympatico.ca)
Date: 10/13/03


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



Relevant Pages

  • Re: Enviro vars or files
    ... > I'm in the midst of creating a bash script for uploading files. ... Put the info in different environment variables. ... > would need to create files that store the information. ... This is critical, if there is e.g. a 'cd' or similar code in the env file, ...
    (comp.unix.shell)
  • Re: logon/logoff scripts...
    ... I am using the %clientname% and %machine% name environment variables to ... each user you can specify a login script but nowhere do I see the ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: Startup script ?
    ... I.E where do I put the script ... Every process has a set of environment variables, ... If there is some script that runs apt-get ... that will get set whenever *lots* of users login, ...
    (Debian-User)
  • Re: exporting a variable to global shells
    ... Environment variables are a user-space concept - ... When the script is exiting the echo stdout's the proxy adress, ... setting up my network differently depending on where/what I connect to. ... With regard to actually *setting* the proxy server, ...
    (Debian-User)
  • RE: DBD::Oracle install failed for fork test in t/10general.t
    ... environment variables $ORACLE_SID and $TWO_TASK. ... the connection is local and a dedicated server is bequeathed ... I'm not sure what 'Unix init process' is, ... It works when I ran a script pointing to the 'blib'. ...
    (perl.dbi.users)