delcaring the script gloabally

General support questions
Post Reply
knzzz
Posts: 157
Joined: 2017/02/25 12:41:42

delcaring the script gloabally

Post by knzzz » 2018/01/23 00:40:07

Hi Team,

i have created and script and placed it in /home/dtail/testing/global/script/ of a non root user, here is my entry of .bash_profile

[dtail@test ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

PATH="$PATH:/home/dtail/testing/global/script/"


but still am unable to run the script globally, after making an entry
export $PATH
I got
export $PATH
bash: export: `/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt': not a valid identifier
i logged out from the user and tried still it dosnt work any suggestion please

Regards
Kanna

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: delcaring the script gloabally

Post by TrevorH » 2018/01/23 01:20:49

An excellent guide for users that are new to Linux can be found at http://rute.gerdesas.com - while this is not official project documentation it is a well-regarded general introduction to Linux and may be of help. For an introduction to the bash shell take a look at http://linuxcommand.org/lc3_learning_the_shell.php
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: delcaring the script gloabally

Post by tunk » 2018/01/23 10:50:28

I think it's export PATH and not export $PATH.
To see if PATH is set correctly you can run this command: env|grep PATH
Can you run the script if you use the full path to it, i.e. /home/dtail/testing/global/script/"scriptname"?
If not, you may check if the executable bit is set.

Post Reply