export

From Initq

Jump to: navigation, search

Set an environment variable. Mark each name to be passed to child processes in the environment.

 PATH=$PATH:/data/myscripts
 export PATH

effectively puts those 2 lines of code in the bash program. So within bash the $PATH variable includes /data/myscript.sh, and because of the export statement, any programs called by bash have the altered $PATH variable. To set a variable:

[root@ohnonono ~]# export BIGBOY="oralay vato"
[root@ohnonono ~]# echo $BIGBOY
oralay vato
[root@ohnonono ~]#

Changing editor in Debian

lexiana:/var/spool/cron# update-alternatives --config editor
 
There are 3 alternatives which provide `editor'.
 
  Selection    Alternative
-----------------------------------------------
          1    /bin/ed
*+        2    /bin/nano
          3    /usr/bin/vim.tiny
 
Press enter to keep the default[*], or type selection number: 3

In all other distros including solaris, bsd and debian do the following to change the default editor. in the file ~/.bashrc put export EDITOR=vim. Next time when you login your default editor will be vim.

Personal tools