in reply to RE: RE: RE: chdir vs. shell behavior
in thread chdir vs. shell behavior

ahunter++!

Right before I read your post, I tried something that was almost there and gave me some p-r-e-t-t-y stupid results. The following is an example of what NOT TO DO:
.bashrc contained: # last line exec /usr/global/distinctuser.pl logout
and my distinctuser.pl user:
# check for files, connect via DBI, make toast, etc... chdir('/bar'); system('/bin/bash'); exit;
So, now that I had everything setup, I logged in. BOOM!!! At the end of .bashrc, we get perl, and the end of perl we call bash (and .bashrc again), and over and over. I just stood there looking at the screen wondering for a second or two why I was getting 800 printouts of fortune.

The method you just described works perfectly. Its true tho that there will be 2 bashes and 1 perl running per user, but that doesn't seem to be affecting the system load. It isn't a heavily used machine anyway. Thanks!

#!/home/bbq/bin/perl
# Trust no1!