Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

shell scripts

I want to run a shell script. When I try to start it, I get message

# ./scull_load
./scull_load: not found

# ls -l
-rwxr-xr-x  1 root     root         1975  Jan  1 1970  scull_load

this is the script

#!/bin/sh
module="samirainterface"
device="kpipe"
mode="664"
#  invoke insmod with all arguments we got#  and use a pathname, as insmod doesn't look in . by default
busybox insmod ./$module.ko $* || exit 1#  retrieve major number
major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices)
#  Remove stale nodes and replace them, then give gid and perms#  Usually the script is shorter, it's scull that has several devices in it.
rm -f /dev/${device}pipe
mknod /dev/${device}0 c $major 0
ln -sf ${device}0 /dev/${device}
chmod $mode  /dev/${device}0

Why doesn't find ths shell this script?

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Sure it is not complaining about something inside the script (f.ex awk) ?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Add the "-xv" option to the top line in your shell script and it will give you more info. It could also be that the# ! "magic" stuff isn't functional, but try the "-xv" option before going down that route...

    - slacker
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    the problem was the awk command. I have no awk.

    thanks for all your help!