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

Re: using `myscript.sh` to change current env



On 9/7/13, Zenaan Harkness <zen@freedbms.net> wrote:

> So I thought, run the script in a subshell, executing the result, like:
> $ `ps1`
>
> The following 3-line script is meant to test exactly this:
>
> #!/bin/bash
> PS1=': '
> echo "export PS1=$PS1"

When I change the last line to this:

echo "export PS1=\"${PS1}\""

I get:
bash: export: `"': not a valid identifier

So it appears that my current/parent shell is tokenizing the output of
`...` based on the space.

I guess, why is it tokenizing on space, yet ignoring the quotes?

TIA
Zenaan


Reply to: