Scripts

Jerry McAllister jerrymc at clunix.cl.msu.edu
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 | script.pl
>  
> script.pl: Command not found.
>  
> What gives??

Sounds like you don't have . in your path or haven't rehashed 
since  you created the file  'script.pl'.    
Try doing ./script.pl < 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'.

////jerry

>  
> TIA
> Eric
>  


More information about the freebsd-questions mailing list