Newbie scripting wa Mandrake that he's about to toss out the window

Hi all,
This message is specifically geared for optikool who was very helpful. Unfortunately, it didn't work my friend - big surprise, not you, my friggin' system - "All is lost, all is lost...

From the top:

Here's what I wanted to do...

#!/bin/sh
# Use of position parameters
# & command substitution using
# the set command to create a
# logon script greeting.
set `date "+%A, %B %d %Y %r"`
echo
echo
echo
echo
echo "Hello John!"
echo "Today is $1 $2 $3 $4"
echo "The current time is $5 $6"
set `date "+%H"`
if [ $1 -ge 0 ] && [ $1 -lt 12 ]
then
echo "Good Morning!"
fi
if [ $1 -ge 12 ] && [ $1 -lt 19 ]
then
echo "Good Afternoon..."
fi
if [ $1 -ge 19 ] && [ $1 -lt 24 ] ;
then echo "Good Evening Sir...^^^^";
fi
echo "Have a beautiful day!"
echo
echo
echo
exit

Here's what I get...

./logon
bash: ./logon: bad interpreter: No such file or directory

And here's some other junk...

echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/jbowers9/bin:./

ls -la /bin/*sh
-rwxr-xr-x 1 root root 66428 Aug 25 2001 /bin/ash*
-rwxr-xr-x 1 root root 580988 Sep 17 2001 /bin/bash*
lrwxrwxrwx 1 root root 3 Sep 12 11:33 /bin/bsh -> ash*
lrwxrwxrwx 1 root root 4 Sep 12 11:37 /bin/csh -> tcsh*
lrwxrwxrwx 1 root root 4 Sep 12 11:33 /bin/rbash -> bash*
lrwxrwxrwx 1 root root 4 Sep 12 11:33 /bin/sh -> bash*
-rwxr-xr-x 1 root root 288956 Sep 6 2001 /bin/tcsh*
-rwxr-xr-x 1 root root 448028 Jul 1 2001 /bin/zsh*

HELP! Otherwise, it's time to reformat that partition! Fear and intimidation work w/computers you know.
jbowers9



Comments

  • i think this came up before, but ...

    it runs fine on my mdk (with similar 'junk', except for write permission for the symlinks - what's the idea about that???); i only get your error if i set the end-of-line to dos/windows. check with vi - if that's the problem, it should say [dos] at the bottom when you open the file.



    : Hi all,
    : This message is specifically geared for optikool who was very helpful. Unfortunately, it didn't work my friend - big surprise, not you, my friggin' system - "All is lost, all is lost...
    :
    : From the top:
    :
    : Here's what I wanted to do...
    :
    : #!/bin/sh
    : # Use of position parameters
    : # & command substitution using
    : # the set command to create a
    : # logon script greeting.
    : set `date "+%A, %B %d %Y %r"`
    : echo
    : echo
    : echo
    : echo
    : echo "Hello John!"
    : echo "Today is $1 $2 $3 $4"
    : echo "The current time is $5 $6"
    : set `date "+%H"`
    : if [ $1 -ge 0 ] && [ $1 -lt 12 ]
    : then
    : echo "Good Morning!"
    : fi
    : if [ $1 -ge 12 ] && [ $1 -lt 19 ]
    : then
    : echo "Good Afternoon..."
    : fi
    : if [ $1 -ge 19 ] && [ $1 -lt 24 ] ;
    : then echo "Good Evening Sir...^^^^";
    : fi
    : echo "Have a beautiful day!"
    : echo
    : echo
    : echo
    : exit
    :
    : Here's what I get...
    :
    : ./logon
    : bash: ./logon: bad interpreter: No such file or directory
    :
    : And here's some other junk...
    :
    : echo $PATH
    : /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/jbowers9/bin:./
    :
    : ls -la /bin/*sh
    : -rwxr-xr-x 1 root root 66428 Aug 25 2001 /bin/ash*
    : -rwxr-xr-x 1 root root 580988 Sep 17 2001 /bin/bash*
    : lrwxrwxrwx 1 root root 3 Sep 12 11:33 /bin/bsh -> ash*
    : lrwxrwxrwx 1 root root 4 Sep 12 11:37 /bin/csh -> tcsh*
    : lrwxrwxrwx 1 root root 4 Sep 12 11:33 /bin/rbash -> bash*
    : lrwxrwxrwx 1 root root 4 Sep 12 11:33 /bin/sh -> bash*
    : -rwxr-xr-x 1 root root 288956 Sep 6 2001 /bin/tcsh*
    : -rwxr-xr-x 1 root root 448028 Jul 1 2001 /bin/zsh*
    :
    : HELP! Otherwise, it's time to reformat that partition! Fear and intimidation work w/computers you know.
    : jbowers9
    :
    :
    :
    :
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion