Path: utzoo!attcan!utgpu!watserv1!watmath!uunet!cs.utexas.edu!samsung!rex!ames!zorch!hplabs!sphere!ruck From: gatelist@zorch.SF-Bay.ORG Newsgroups: unix-pc.general Subject: Submission for Unix-PC Message-ID: <8912121021.AA06028@hp-lsd.HP.COM> Date: 12 Dec 89 10:21:38 GMT Sender: scott@zorch.SF-Bay.ORG Organization: Unix-PC/Mail Gateway Lines: 36 Apparently-To: zorch!unix-pc Regarding "make" and input/output redirection I want to tee make output to a logfile. But a function in the Makefile doesn't like the way I'm redirecting output. Command 1 works, 2 doesn't ("sh: test: argument expected"). 1. $ make su_bin 2. $ make su_bin 2>&1 | tee logfile Here's the Makefile excerpt: su_bin: # if not user bin, then abend if [ `ps -f | \ awk '$$2==PID {print $$1}' PID=$$$$ -` != bin ]; then \ echo "Makefile: su bin before making" >&2; \ exit 2; \ fi This question was posed to a friend using HP-UX, who said > I ran your makefile here and it works with and without the > redirection. So I can't duplicate the problem. I can speculate > that the awk script is not getting any input because the redirection > and the reference to '-' in the makefile confuse things on your > system. Why not just use 'whoami' in the makefile? But of course, we do not have whoami, and I replied > "su" (on my system) will not make an entry in /etc/utmp, the file "who" > and "who am i" normally examine. Instead, "su" makes an entry in > /usr/adm/sulog. For that reason, "who am i" will not reflect the user > one is "su"ed to. Any suggestions or enlightening comments would be greatly appreciated. (am using 3.51 OS, 3.5 development set) John R Ruckstuhl, Jr, ...!hplabs!hp-lsd!sphere!ruck