View Single Post
  #1   (View Single Post)  
Old 30th November 2008
chavez243 chavez243 is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Leamington, ON
Posts: 50
Default Shell Scripting with BSD

Anyone know of a good resource to read up on shell scripting?

I'm working on a script that take a single argument and checks various files for the presence of that expression:

eg. ./script.sh filename


so far I have:

Code:
#!/bin/sh
check=$1
result=`cat /path/to/file/file1 | grep $1`
if ($result !="")
   then 
   echo "$check found"
   exit
fi
echo "$check not found"
it's not doing exactly what I want though, I've googled, but haven't come across anything definitive... any help appreciated

TIA
Reply With Quote