View Single Post
newdaddy

 
Member Since: Sep 28, 2007
Posts: 8
newdaddy is on a distinguished road

newdaddy is offline
/Users/crose1 > alias oneCol "`tr ' ' '\012' < $1 > $2`"
tcsh: Missing name for redirect.
/Users/crose1 > alias oneCol "`tr ' ' '\012' < \$1 > \$2`"
/Users/crose1 > oneCol test1 test1.out
tcsh: test1: Permission denied.
/Users/crose1 > which oneCol
oneCol: aliased to
/Users/crose1 > alias oneCol "tr ' ' '\012' < $1 > $2"
/Users/crose1 > oneCol test1 test1.out
tcsh: Missing name for redirect.
/Users/crose1 > alias oneCol
tr ' ' '\012' < >
/Users/crose1 > alias oneCol "tr ' ' '\012' < \$1 > \$2"
/Users/crose1 > oneCol test1 test1.out
tcsh: : No such file or directory.
/Users/crose1 > alias oneCol
tr ' ' '\012' < \ > \
/Users/crose1 > alias oneCol `tr ' ' '\012' < $1 $2`
tcsh: $1: Ambiguous.
/Users/crose1 > alias oneCol `tr ' ' '\012' < \$1 \$2`
tcsh: $1: No such file or directory.

OK, I give up. Instead, I just put this in my bin directory, instead, as a file named oneCol (and then gave it execute permission, and did a rehash).

!#/bin/sh
tr ' ' '\012' < $1 > $2

This command isn't such a great example, because it's a command you might otherwise want to pipe to something else (but because of the argv redirection, you can't). There are other commands which are much more appropriate for this, and for each of those, I'll just move them each to their own file in my local bin dir.

Thanks rman for trying to help me out - I appreciate it.
QUOTE Thanks