sh & export

Fbsd8 fbsd8 at a1poweruser.com
Tue Jan 29 00:41:37 UTC 2013


Lowell Gilbert wrote:
> Fbsd8 <fbsd8 at a1poweruser.com> writes:
> 
>> I'm reading a script and i see a lot of exports.
>>
>> Is there some command to display the exported environment?
>>
>> The env command does not show them. Only see things made by setenv command.
> 
> You're not clear on which shell the script is using. 
> The subject line implies /bin/sh, but that doesn't
> have a setenv command. 
> 
> I don't think there's a direct way to show exported 
> variables in /bin/sh, but starting an inferior shell 
> and looking at the environment there should do it.
>


This is what I am looking at in a sh script

echo export jail_${jailname}_hostname=\"${jailname}\"
puts it into the env
and this brings it back out
eval jailname=\"\$jail_${jailname}_hostname\"

Question is how can I display from the console command
line what has been exported?

env issued on the console command line does not show
any thing named jail.





More information about the freebsd-questions mailing list