Shell problems


#1

Two issues, possibly related.

  1. I have frequently used chsh to change my shell from ksh to bash. The change will persist for a while, but ultimately revert back to ksh in /etc/passwd

  2. I am currently unable to execute php scripts from the command line.

[yoda]$ php script.php
-bash: php: command not found
[yoda]$ php -v
-bash: php: command not found
[yoda]$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

All scripts executed through http seem to be working.


#2

The change is more permanent if you make it in the Panel. Manage Users, Edit the user, User Account Type.

Finding php should be a matter of getting the path right, as you know. You are close.

[quote]/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

[/quote]

$ whereis php
php: /etc/php /usr/local/bin/php /usr/local/lib/php

$ whereis php5
php5: /etc/php5 /usr/local/php5

tor.eff.org
Promos: MaxTOR: Save [color=#CC0000]Maximum[/color] TOR: Save Maximum and [color=#00CC00]give $1 to TOR[/color]


#3

First, log into the Panel > Users > Manage Users, edit your user and set your which you want to use ksh or bash. The effect should hold, but may take up to an hour to take effect.

Next, have you edited .bash_profile or an equivalent for ksh? That perhaps might be the problem, but that’s just a guess. I’d do the above change and then see if your problems clear up. If not, contact support.

–Matttail
art.googlies.net - personal website


#4

Mattail/Tor:

Thanks for the panel suggestion.

As to not finding php, I’ve been using shell access here since 2004 - ksh, through a putty terminal. Never had a problem before. There is currently no .profile in my home directory, and I can assure you that I didn’t delete it.

My .bash_profile was essentially empty:

~/.bash_profile: executed by bash(1) for login shells.

umask 002
PS1=’[\h]$ ’

I don’t even know where my PATH was being set.

Nevertheless, it is now set to:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/etc/php:/usr/local/bin/php:/usr/local/lib/php

in .bash_profile

but I’m still getting errors:

[yoda]$ which php
[yoda]$ whereis php
php: /etc/php /usr/local/lib/php
[yoda]$ php -v
-bash: php: command not found

Also, there is no php in /usr/local/bin on yoda


#5

seems to me that your shell got messed up some how, I’d contact support.

–Matttail
art.googlies.net - personal website