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

Re: Exported (ba)sh functions in the environment

On 26/05/12 04:34, Russ Allbery wrote:
> Philip Ashmore <contact@philipashmore.com> writes:
>> Here's where I wish I was a shell script guru:
>>    for var in `cat set.txt`; do
>>       { if in env discard }
>>    done
>>    { sort offenders by decending size }
>> Here's a summary of the ones that caught my eye. Sorry if I missed
>> anyone out!
> Oh.  This is smelling like artifacts of bash-completion; perhaps set is
> dumping your completion settings.  I'm pretty sure those are not copied
> into subshells and are only loaded in interactive shells.
In my original email I ran "set > set.txt && ls -lsa set.txt".

Putting the same into a script:
   set > set.txt && ls -lsa set.txt

...got me 2353 bytes - I'll be a donkeys ass!

It looks like the fact that I typed it made it interactive, even though it
didn't require/allow any interaction.


Reply to: