On Tue, 20 Jun 2006, Avraham Rosenberg wrote:

> Hi experts,

there are no experts for this subject here, it seems. try "hobbists" -
you might have better luck ;)

anyway, i got some hunch that you'll need to test, see below:

> After leaving the 64-system for a while, yesterday when I returned to it,
> I found with displeasure that the script do_dchroot (I am
> refering to the Debian GNU/Linux AMD64 HOW-TO by Rosenberg,
> Iverson, von Brederlow, Schueler, Mills and Pariset) does not
> work any more. The error message: line 7: exec: dchroot: not
> found.

so there is no 'dchroot' binary in the path...

> dchroot was there and kicking: when I tried
> dchroot -c ia32 -d xv *jpg it worked well.

so when you run the command directly it works (i.e. in the current shell's
environment, there is a dchroot in the path).

> I tried instead the script xv32:
> #!/bin/sh
> /usr/bin/dchroot -c ia32 -d -q xv $*
>
> Output: /usr/bin/dchroot: no such file or directory

so dchroot is not found under /usr/bin/dchroot.

did you try to first run "which dchroot" from the shell, to see where
dchroot is located?
>
> The only way it worked was:
> #!/bin/sh
> if [ -f /usr/bin/dchroot ]; then dchroot -c ia32 -d -q xv $*; fi

worked = executed properly? or worked = did not emit any error?

add an 'else' clause to the above if, to see that the 'if' part actually
took place.

> I tried then to combine the conditional with the original
> do_dchroot:
> #!/bin/sh
> ARGS=""
> for i in "$@" ; do
>       ARGS="$ARGS '$i'"
> done
>
> #exec dchroot -c ia32 -d -q "`basename $0`" "$ARGS"
> if [ -f /usr/bin/dchroot ]; then exec dchroot -c ia32 -d -q "`basename $0`" 
> "$ARGS"; fi
>
> This time there were no error messages, but no output either.

perhaps the system is playing some tricks on you? perhaps when it invokes
this shell script, its environment gets screwed in some way?

to debug this, why don't you add 'echo' before the above 'exec', and see
what it going on (or run this scrip tusing 'sh -x .....')?

> I'll be damned!

until you start adding debug messages to your script. then you'll be
puzzled - and that's a much better state of being ;)

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to