-   Linux From Scratch (
-   -   Expect cannot find commands (

feilb 07-22-2008 11:59 AM

Expect cannot find commands
So, after i have chrooted into /mnt/lfs and am installing binutils, there is a test asking to check whether ptys are set up correctly using


expect -c "spawn ls"
This fails not because there are no available ptys, but because expect cannot find ls.

LS is in /tools/bin, which is in $PATH

I can execute this correctly by typing:


expect -c "spawn /tools/bin/ls"
Where is my mistake?

Mr. C. 07-22-2008 01:37 PM

How have you verified the PATH that expect actually sees?

feilb 07-22-2008 02:00 PM

Yeah, so it turns out that i forgot to export PATH. PATH looked fine when i did echo $PATH, but it was not available to everything else.

Lesson learned: don't use echo to test environment variables

All times are GMT -5. The time now is 02:12 AM.