cat in script

Eric Miller emiller at techskills.com
Fri Oct 25 10:51:49 PDT 2002


* Eric Miller <emiller at techskills.com> [2002-10-25 06:39]:
> Starting a chapter 6 scripted install (writing my own scripts).  My
chapter
> 5 scripts are solid, got all of Chapter five done flawlessly with three
> scripts from fdisk to chroot!
>
> So, figured out that i needed to change the #! to match /static/bin/bash
in
> the chroot environment.
>
> when I attempt to use the 'cat' command in my script I get an error,
command
> not found.
>
Is the directory for cat in your script's PATH?


Well, the script itelf is in /static/bin (under $LFS, but after chroot so
its just /static/bin at that point), which is clearly in the path declared
at chroot.  Why would I need to declare a seperate path in the script if
'cat' works fine from the command line?  Wouldn't that indicate that the
'cat' command is already in the path?

The problem is twofold:  when I leave the script as #!/bin/sh I get an
invalid iterpreter error, so it doesnt even start the script.  I beleive
this is because the chroot statement ends with /bin/bash as the shell.

So, when I change the script to #!/bin/bash to match the chroot environment,
the script runs fine.  There are about 100 lines before the 'cat' error, and
I have it stepped with a read statement so I can debug each step.  However,
when it reaches the 'cat' line, it returns command not found.  When booted
back out to the prompt, I can run 'cat' without issue.



-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message



More information about the lfs-chat mailing list