Jerry McAllister jerrymc at
Mon Feb 16 09:08:29 PST 2004

> Hello FreeBSD people.
> Perhaps this is the wrong place to ask such an elemental question...
> I'm trying to feed a text file into a script.
> Script is suppose to take relevant parts and output them to a new
> file...
> Script is marked executable...
> less textfile |
> Command not found.
> What gives??

Sounds like you don't have . in your path or haven't rehashed 
since  you created the file  ''.    
Try doing ./ < textfile.
If that works, then try doing a rehash.  I don't know
which shell you are using, but with tcsh/csh just type rehash
and a CR/ENTER at a prompt.

When you first start the shell, it makes a hash list of all the
files in your path.    That is where it searches for executables
each time you type in somthing at the prompt that does not begin 
with either . or /    
Typing the rehash shell command, causes it to update its hash list.

Note, just using the '<' redirect command is enough to pipe the
file to STDIN.   You don't need any other command such as 'less'.


> Eric

More information about the freebsd-questions mailing list