Variable: /etc/environment

General support questions
Post Reply
Roswell974
Posts: 2
Joined: 2018/12/13 10:40:04

Variable: /etc/environment

Post by Roswell974 » 2018/12/13 10:47:24

hello,

I was wrong in changing the variables (/etc/environment)
I followed this tutorial: https://tecadmin.net/install-java-non-lts-on-centos/
Now by connecting to me via SSH, I can not execute the commands anymore.
How to restore / etc / environment
Can you help me please?

This is error with ROOT access:
-bash: id : commande introuvable
/usr/local/bin/phmotd: line 3: [: == : opérateur unaire attendu
Bienvenue \ Welcome
-bash: whoami : commande introuvable
-bash: grep : commande introuvable
-bash: mesg : commande introuvable
-bash: dircolors : commande introuvable
[root@vps ~]$


This is error with UTILISATOR acces:
-jailshell: id : commande introuvable
-jailshell: perl : commande introuvable
-jailshell: perl : commande introuvable
/usr/local/bin/phmotd: line 3: [: == : opérateur unaire attendu
Bienvenue \ Welcome
-jailshell: whoami : commande introuvable
-jailshell: grep : commande introuvable
-jailshell: mesg : commande introuvable
-jailshell: dircolors : commande introuvable
utilisator@vps [~]#

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: Variable: /etc/environment

Post by stevemowbray » 2018/12/13 11:32:54

You have broken your path, specify the full path to programs to use them (e.g. /bin/vi /etc/environment to edit the file)

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Variable: /etc/environment

Post by avij » 2018/12/13 11:59:36

/etc/environment is typically an empty file. To clear it without an editor, run >/etc/environment as root.

Roswell974
Posts: 2
Joined: 2018/12/13 10:40:04

Re: Variable: /etc/environment

Post by Roswell974 » 2018/12/13 12:21:58

Thank you it works.

How to avoid closing my script?
I run it with the command ./NameFile.sh
But when I close the terminal the script stops.
Is there a nohup function to use?

Post Reply