From: Yuriy Kashirin <yura@emict.com>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] bash: export JAVA_HOME
Date: Mon, 10 Jul 2006 15:06:27 +0300
Message-ID: <200607101506.27709.yura@emict.com> (raw)
In-Reply-To: <44B23693.5030809@stc.donpac.ru>
On Monday 10 July 2006 14:14, Eugene Prokopiev wrote:
> Теперь главный вопрос: как сделать, чтоб после логина пользователя
> он видел бы в переменной JAVA_HOME /usr/lib/j2se1.5-sun.
[ skiped ]
> if [ -f "$f" -a -r "$f" -a -x "$f" -a -s "$f" -a ! -L "$f" ];
[ skiped ]
> Т.е. выпадают ссылки, ведущие наружу. Вопрос: что делает if в
> profile, делает ли он это правильно (что тогда неправильно?) или
> нет
Это из-за условия -a ! -L "$f", что означает "и если $f не ссылка". То
есть выпадают все ссылки (не только ведущие наружу). Судя по:
> $ ls -la /etc/profile.d
> -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
> 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
...игнорирование ссылок сделано, чтоб повторно не обрабатывать файл,
на который там же есть ссылка. Зачем в /etc/profile.d лежат и файлы,
и ссылки на них - хз.
> (как тогда исправить?)
Проще всего переделать условие на:
if [ -f "$f" -a -r "$f" -a -x "$f" -a -s "$f" ]
Но не забыть поудалять ссылки, указывающие на файлы, лежащие в том же
директории. Или убрать из таких ссылок или из самих файлов
расширение .sh
--
Best regards
Yuriy Kashirin
next prev parent reply other threads:[~2006-07-10 12:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 9:12 [sisyphus] # cat /usr/lib/j2se1.5-sun/j2se.sh JAVA_HOME=/usr/lib/j2se1.5-sun Eugene Prokopiev
2006-07-10 10:11 ` [sisyphus] bash: export JAVA_HOME Eugene Prokopiev
2006-07-10 10:14 ` Alexey I. Froloff
2006-07-10 11:14 ` Eugene Prokopiev
2006-07-10 12:06 ` Yuriy Kashirin [this message]
2006-07-10 13:14 ` Eugene Prokopiev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200607101506.27709.yura@emict.com \
--to=yura@emict.com \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git