Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
/etc/profile uses 'print' to find TMPDIR
2007-08-28, 06:56 AM
Post: #1
/etc/profile uses 'print' to find TMPDIR
Hi,

in /etc/profile, there is some code to set TMPDIR to a reasonable value.

This code uses print to check for a specific directory.

With /bin/ksh, print is a shell-builtin similar to echo.

But for bash, print is not a shell-builtin, so PATH is searched for print,
resulting to use '/dev/fs/C/WINDOWS/system32/print.exe' here.

Is there a specific reason to not use the shell-noop ":" to create an empty file ?
    if [ -d "${_i}" ]; then
				
Find all posts by this user
Quote this message in a reply
2007-08-28, 07:44 AM
Post: #2
RE: /etc/profile uses 'print' to find TMPDIR
Or, since the code searches for these environment variables
INTERIX_TMPDIR
				
Find all posts by this user
Quote this message in a reply
2007-08-28, 11:04 PM
Post: #3
RE: /etc/profile uses 'print' to find TMPDIR
Ehm, no - I'm happy with the outcome of TMPDIR=/tmp.

I just want to point out that use of 'print', which may result to the use of 'print.exe'.

What my troubles have been:

I have some script to set up environment for a cron-job, which sources /etc/profile prior to set some additional variables.

Now, when I sourced this script within my login-bash to get the additional variables, sourcing /etc/profile hangs because 'print' waited for input on stdin.

Thing is, because having unix-csh years ago, I had some bash-function 'print()' in ~/.profile, which used 'pr' piped to 'lp' to print some files.

This is the reason why sourcing /etc/profile on logged in bash prompt hangs, because 'pr' reads from stdin.

But then I realized that even if I do not have that bash-function, and 'print' is not bash-builtin, /dev/fs/C/WINDOWS/system32/print.exe is used here to do the noop.

Just can't believe this being expected behaviour...

/haubi/
Find all posts by this user
Quote this message in a reply
2007-08-28, 11:47 PM
Post: #4
RE: /etc/profile uses 'print' to find TMPDIR
> Just can't believe this being expected behaviour...

No, it's not something done intensionally against bash.
The login script was originally written just for sh/ksh.
The script can be "naturally" overloaded to be used by bash.
It seemed to be okay. This is the first time someone has noticed this problem
in 3-1/2 years.

I'll look at making a patch on /etc/profile for bash users.
Thanks for letting us know.
Find all posts by this user
Quote this message in a reply
2007-08-29, 12:23 AM
Post: #5
RE: /etc/profile uses 'print' to find TMPDIR
Looks like I fall into much more traps than others - I had the problem since I started working with Interix because of my 'print' function...

Thank you!

haubi
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)