Sam Trenholme's webpage
This article was posted to the Usenet group alt.hackers in 1995; any technical information is probably outdated.

Re: A few requests (and, of course, ObHacks)

Article: 7421 of alt.hackers
From: (Charles Howes)
Newsgroups: alt.hackers
Subject: Re: A few requests (and, of course, ObHacks)
Date: 19 Feb 1995 06:43:20 -0800
Organization: Simon Fraser University
Lines: 102
Approved: alt.hackers
Message-ID: 3i7le8$
Status: RO

Paul Smith ( wrote:

] Question #2:

] Anyone know how to redirect output to stderr in csh?  I know for sh you just
] tack "1>&2" on the end of a line, but i've not found an
equivalent for csh.

   (somecommand > /dev/tty) |& cat

will insure the output goes to your screen and stderr becomes stdout.
#include <stdio.h>
  char c;
  while (read(0,&c,1)==1) write (2,&c,1);

  somecommand |

will redirect stdout to stderr, if that's really how you want it.

  Infinite loop makefile.  It runs itself every five seconds, and if
  it finds anything to compile, it does so and then runs it.
  Great for X applications.

  Type 'make run' to start.

  Take out the 'echo' statements when you understand it.

SHELL = /bin/sh

# Written by - 1995-02-19 06:19:26

OBJS=assign1.o main.o

# I work from the /tmp directory; it's faster than NFS.
# Crashing/rebooting erases the /tmp directory.
# So, I like the best of both worlds.

# I could find no built-in replacement for OBJS; $? didn't work right.
# Otherwise, CMD and OBJS would be unnecessary.
$(CMD) : $(OBJS)
	@echo Linking $(OBJS) '->' $@
	@$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)

# The guts of the infinite loop; the '-' means ignore errors.
run :
	@echo Running infinite loop
	@-while true ; do make test ; sleep 5 ; done

# This prevents the message ' is up to date' from occuring
test :

# Builds and runs CMD
# : $(CMD)
	@echo Running $(CMD) now.
	@-cp * $(BACKUPDIR)

# Not actually used, but darned useful at other times.
# This is copied from the default rules.
	@echo Compiling... $? '->' $@
	@$(CC) $(CFLAGS) -o $@ $? $(LDFLAGS)

# Turns source files into OBJS.  This is copied from the default rules.
	@echo Compiling... $? '->' $@
	@$(CC) $(CFLAGS) -c $? $(LDFLAGS)
Charles Howes --

All parts should go together without forcing.  You must remember that the
parts you are reassembling were disassembled by you.  Therefore, if you
can't get them together again, there must be a reason.	By all means, do
not use a hammer.			--IBM maintenance manual, 1925

gone Parent

Back to index