DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 30th November 2008
chavez243 chavez243 is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Leamington, ON
Posts: 50
Thanked 2 Times in 2 Posts
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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell scripting resources J65nko Programming 0 23rd December 2008 09:57 PM
ports config and makefile scripting boincv FreeBSD Ports and Packages 6 1st October 2008 07:57 AM
Good Bash/Scripting book? cwhitmore Programming 7 15th August 2008 01:54 AM
Color shell? giga FreeBSD General 3 14th August 2008 12:07 AM
Shell Script. bsdnewbie999 Programming 21 15th July 2008 07:54 AM


All times are GMT. The time now is 12:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick