zsh-users
 help / color / mirror / code / Atom feed
* zsh and login shells.
@ 1999-02-12 21:22 Larry P . Schrof
  1999-02-13  2:46 ` Timothy J Luoma
  0 siblings, 1 reply; 4+ messages in thread
From: Larry P . Schrof @ 1999-02-12 21:22 UTC (permalink / raw)
  To: zsh-users

Until I convince other admins at our site to put zsh in /etc/shells,
I'm running it out of my home directory.

I tried putting

[ -f ${HOME}/loc/bin/zsh ] && exec ${HOME}/loc/bin/zsh -l

in my .login (and made .login executable).

However, upon logging in, I simply get the ksh prompt, as if the
conditional statement evaluated to false.  When running this on the
command line, it works just fine.

I know the system ksh was reading my old .login file before I
moved it out of the way and put in the (simple) new one.

Any ideas?

- Larry


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh and login shells.
  1999-02-12 21:22 zsh and login shells Larry P . Schrof
@ 1999-02-13  2:46 ` Timothy J Luoma
  1999-02-13  7:14   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy J Luoma @ 1999-02-13  2:46 UTC (permalink / raw)
  To: Larry P . Schrof; +Cc: zsh-users

	Author:	"Larry P . Schrof" <schrof@cig.mot.com>
	Date:	Fri, 12 Feb 1999 15:22:16 -0600
	ID:	<199902122123.QAA05026@po_box.cig.mot.com>

> [ -f ${HOME}/loc/bin/zsh ] && exec ${HOME}/loc/bin/zsh -l
>
> in my .login (and made .login executable).
>
> However, upon logging in, I simply get the ksh prompt, as if the
> conditional statement evaluated to false.  When running this on the
> command line, it works just fine.
>
> I know the system ksh was reading my old .login file before I
> moved it out of the way and put in the (simple) new one.


What would happen when zsh starts and processes .login ?

Also, the condition should not be '-f', I would suggest something like this

check that it IS executable
	and NOT a directory
	and NOT a link

if [ -x ${HOME}/loc/bin/zsh \
-a ! -d ${HOME}/loc/bin/zsh \
-a ! -h ${HOME}/loc/bin/zsh ]; then

	exec ${HOME}/loc/bin/zsh -l
	
fi

I would try putting that in .kshrc or equivalent.
(on 2nd thought, that may not be ksh syntax)


Can you change your shell to /bin/sh and put the above in .profile and see  
if that works?

If you wanted to be more verbose:

if [ -x ${HOME}/loc/bin/zsh \
-a ! -d ${HOME}/loc/bin/zsh \
-a ! -h ${HOME}/loc/bin/zsh ]; then

	exec ${HOME}/loc/bin/zsh -l
	
else

	if [ -f ${HOME}/loc/bin/zsh ]; then
		echo ${HOME}/loc/bin/zsh exists
	
	else
		echo ${HOME}/loc/bin/zsh not found
		
	fi
	
	if [ -d ${HOME}/loc/bin/zsh ]; then
		echo ${HOME}/loc/bin/zsh is a directory
	fi
	
	if [ -h ${HOME}/loc/bin/zsh ]; then
		echo ${HOME}/loc/bin/zsh is a link
	fi
fi


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh and login shells.
  1999-02-13  2:46 ` Timothy J Luoma
@ 1999-02-13  7:14   ` Bart Schaefer
  1999-02-15 15:12     ` Larry P . Schrof
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 1999-02-13  7:14 UTC (permalink / raw)
  To: Timothy J Luoma, Larry P . Schrof; +Cc: zsh-users

On Feb 12,  9:46pm, Timothy J Luoma wrote:
} Subject: Re: zsh and login shells.
}
} 	Author:	"Larry P . Schrof" <schrof@cig.mot.com>
} 	Date:	Fri, 12 Feb 1999 15:22:16 -0600
} 	ID:	<199902122123.QAA05026@po_box.cig.mot.com>
} 
} > I know the system ksh was reading my old .login file before I
} > moved it out of the way and put in the (simple) new one.

Something just occurred to me that hadn't earlier:

As ksh doesn't normally read a file named .login (it uses .profile), it
must be the case that the system /etc/profile is reading .login with the
"." command.  Is your .login writable by anyone other than yourself?
Perhaps /etc/profile tests that someone else couldn't have written into
your .login before it reads it?

} What would happen when zsh starts and processes .login ?

Zsh would only process .login if it were explicitly sourced.  The usual
file for zsh is .zlogin ...

} Also, the condition should not be '-f', I would suggest something like this
} 
} check that it IS executable
} 	and NOT a directory
} 	and NOT a link

and NOT writable by group/other ...

I'm not sure the "not a link" test is all that useful.  If somebody could
put a link in his loc/bin directory, they could also replace the entire
executable.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zsh and login shells.
  1999-02-13  7:14   ` Bart Schaefer
@ 1999-02-15 15:12     ` Larry P . Schrof
  0 siblings, 0 replies; 4+ messages in thread
From: Larry P . Schrof @ 1999-02-15 15:12 UTC (permalink / raw)
  To: zsh-users

> Zsh would only process .login if it were explicitly sourced.  The usual
> file for zsh is .zlogin ...

I was being dumb - I put into my .zprofile and everything was fine.

> I'm not sure the "not a link" test is all that useful.  If somebody could
> put a link in his loc/bin directory, they could also replace the entire
> executable.

The reason that I personally wouldn't use the link test is that I have
a link called -zsh pointing to the zsh binary in my home directory
software tree.  That way I can exec zsh and it shows up in the process
table as -zsh

- Larry (Thanks for the help)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-02-15 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-12 21:22 zsh and login shells Larry P . Schrof
1999-02-13  2:46 ` Timothy J Luoma
1999-02-13  7:14   ` Bart Schaefer
1999-02-15 15:12     ` Larry P . Schrof

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).