How run a shell script

Hi, group,

The following buildfile is to boot my PC for further use, which to invoke
a PhAB application. Unfortunely, the shell script doesn’t work(“Unable to
start” error at boot) . At the shell even typeing the script in I got
the"exec
format error" message. So what do you think the buildfile. Your
modifications are welcomed. How do you start a Photon apps at
boot. Thanks.

###############
[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot procnto
}
[+script] .script = {
devc-con &
reopen /dev/con1
#Directly run it works as planed

/hello &

#But the shell script to invoke “hello” doesn’t work
/ph_start1 &
[+session] esh &
}
[type=link] /dev/console=/dev/con1
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[perms=+r,+x]
libc.so

[data=copy]
[perms=+r,+x]
devc-con
esh
/ph_start1=/home/peter1/phembed/ph_start1
/hello=/home/peter1/phembed/hello
ls
###############

Ph_start1 is simple(with “chmod a+x” feature), just to invoke hello
executable:

/hello &

hello is a “Hello world” C program(non_Photon) just for test. At the end,

I want to start a Photon apps using a shell script at boot.

Peter Z
pzdec26@1010.com

Peter Z wrote:

Hi, group,

#But the shell script to invoke “hello” doesn’t work
/ph_start1 &

Try:

sh /ph_start1 &

Rennie

Peter Z <pzdec26@1010.com> wrote:

Hi, group,

The following buildfile is to boot my PC for further use, which to invoke
a PhAB application. Unfortunely, the shell script doesn’t work(“Unable to
start” error at boot) . At the shell even typeing the script in I got
the"exec
format error" message. So what do you think the buildfile. Your
modifications are welcomed. How do you start a Photon apps at
boot. Thanks.

To be able to run a shell script as if it were an executable, it must
start with the line:

#!/bin/sh

This tells the loader that this file is not an executable itself,
but that it should load the program /bin/sh and pass the script to
that new executable for parsing.

-David



###############
[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot procnto
}
[+script] .script = {
devc-con &
reopen /dev/con1
#Directly run it works as planed

/hello &

#But the shell script to invoke “hello” doesn’t work
/ph_start1 &
[+session] esh &
}
[type=link] /dev/console=/dev/con1
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[perms=+r,+x]
libc.so

[data=copy]
[perms=+r,+x]
devc-con
esh
/ph_start1=/home/peter1/phembed/ph_start1
/hello=/home/peter1/phembed/hello
ls
###############

Ph_start1 is simple(with “chmod a+x” feature), just to invoke hello
executable:

/hello &

hello is a “Hello world” C program(non_Photon) just for test. At the end,

I want to start a Photon apps using a shell script at boot.

Peter Z
pzdec26@1010.com


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.