bash - How to run a script everywhere in linux -


i have script host_avai.sh in /home/campus27/zwang10/bin. , in .bashrc, add export path=$path:/home/zwang10/bin/host_avai.sh. after type host_avai.sh, shows host_avai.sh: command not found.. can me here?

added

$ echo $shell /bin/tcsh 

your path should path=$path:/home/zwang10/bin , add in .bash_profile. after run script following command :

$ . .bash_profile 

make sure host_avai.sh must have execute permission.

$ cd  /home/zwang10/bin $ chmod +x host_avai.sh 

now run command anywhere.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -