[sisyphus] bash: export JAVA_HOME

Eugene Prokopiev =?iso-8859-1?q?prokopiev_=CE=C1_stc=2Edonpac=2Eru?=
Пн Июл 10 15:14:27 MSD 2006


Alexey I. Froloff пишет:
> * Eugene Prokopiev <prokopiev@> [060710 14:11]:
> 
>># cat /usr/lib/j2se1.5-sun/j2se.sh
>>export JAVA_HOME="/usr/lib/j2se1.5-sun"
>># /usr/lib/j2se1.5-sun/j2se.sh
> 
> Попробуйте вместо этого сделать
> . /usr/lib/j2se1.5-sun/j2se.sh

Да, работает ...

Теперь главный вопрос: как сделать, чтоб после логина пользователя он 
видел бы в переменной JAVA_HOME /usr/lib/j2se1.5-sun. Исправил 
/etc/profile так:

for f in /etc/profile.d/*.sh; do
         echo "outer : $f"
         if [ -f "$f" -a -r "$f" -a -x "$f" -a -s "$f" -a ! -L "$f" ]; then
                 echo "inner : $f"
                 . "$f" &> /tmp/fff
         fi
done

если запускать его вручную, то я вижу:

$ . /etc/profile
outer : /etc/profile.d/0lang.sh
inner : /etc/profile.d/0lang.sh
outer : /etc/profile.d/color_ls.sh
inner : /etc/profile.d/color_ls.sh
outer : /etc/profile.d/configure_keyboard.sh
inner : /etc/profile.d/configure_keyboard.sh
outer : /etc/profile.d/console.sh
inner : /etc/profile.d/console.sh
outer : /etc/profile.d/j2se.sh
outer : /etc/profile.d/lang.sh
outer : /etc/profile.d/less.sh
inner : /etc/profile.d/less.sh
outer : /etc/profile.d/libglib2.sh
inner : /etc/profile.d/libglib2.sh
outer : /etc/profile.d/shared-mime-info.sh
inner : /etc/profile.d/shared-mime-info.sh
outer : /etc/profile.d/tmpdir.sh
inner : /etc/profile.d/tmpdir.sh
outer : /etc/profile.d/xhost.sh
inner : /etc/profile.d/xhost.sh

$ ls -la /etc/profile.d
total 80
drwxr-xr-x  2 root root 4096 Jul 10 13:11 .
drwxr-xr-x 67 root root 4096 Jul 10 12:20 ..
-rwxr-xr-x  1 root root 1569 May 18 13:03 0lang.csh
-rwxr-xr-x  1 root root 1792 May 18 13:03 0lang.sh
-rwxr-xr-x  1 root root  511 May 22 18:12 color_ls.csh
-rwxr-xr-x  1 root root  787 May 22 18:12 color_ls.sh
-rwxr-xr-x  1 root root  196 May 18 13:03 configure_keyboard.csh
-rwxr-xr-x  1 root root  207 May 18 13:03 configure_keyboard.sh
-rwxr-xr-x  1 root root  286 May 18 13:03 console.csh
-rwxr-xr-x  1 root root  267 May 18 13:03 console.sh
lrwxrwxrwx  1 root root   47 Jul 10 12:21 j2se.csh -> 
/etc/alternatives/links/|etc|profile.d|j2se.csh
lrwxrwxrwx  1 root root   46 Jul 10 12:21 j2se.sh -> 
/etc/alternatives/links/|etc|profile.d|j2se.sh
lrwxrwxrwx  1 root root    9 May 18 13:03 lang.csh -> 0lang.csh
lrwxrwxrwx  1 root root    8 May 18 13:03 lang.sh -> 0lang.sh
-rwxr-xr-x  1 root root  164 May 18 13:03 less.csh
-rwxr-xr-x  1 root root  241 May 18 13:03 less.sh
-rwxr-xr-x  1 root root  474 Apr 10 17:47 libglib2.csh
-rwxr-xr-x  1 root root  467 Apr 10 17:47 libglib2.sh
-rwxr-xr-x  1 root root   45 May 18 13:03 shared-mime-info.csh
-rwxr-xr-x  1 root root   45 May 18 13:03 shared-mime-info.sh
-rwxr-xr-x  1 root root  627 May 18 13:03 tmpdir.csh
-rwxr-xr-x  1 root root  426 May 18 13:03 tmpdir.sh
-rwxr-xr-x  1 root root  180 May 18 13:03 xhost.csh
-rwxr-xr-x  1 root root  172 May 18 13:03 xhost.sh

Т.е. выпадают ссылки, ведущие наружу. Вопрос: что делает if в profile, 
делает ли он это правильно (что тогда неправильно?) или нет (как тогда 
исправить?)

-- 
С уважением, Прокопьев Евгений




Подробная информация о списке рассылки Sisyphus