From owner-freebsd-questions@FreeBSD.ORG Sun Jan 29 15:10:18 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 594AB16A420 for ; Sun, 29 Jan 2006 15:10:18 +0000 (GMT) (envelope-from christou44@yahoo.com) Received: from web37109.mail.mud.yahoo.com (web37109.mail.mud.yahoo.com [209.191.85.111]) by mx1.FreeBSD.org (Postfix) with SMTP id 31F0A43D46 for ; Sun, 29 Jan 2006 15:10:17 +0000 (GMT) (envelope-from christou44@yahoo.com) Received: (qmail 96213 invoked by uid 60001); 29 Jan 2006 15:10:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=wkRpwpntzVKDSXZAji2aGLaHPzgwmmyPPgb1dxVeQD9J64xl30f3cjNIKptJMMh0lptnJMlEvSmeNSylO3DoON1J+tElFP0AgOihifDwYIe4EIzwthMA8GV76Biv0ehQymdgeXN85G6xJIaHsAiZdysakT2CdW8lVZ32CLnGaqs= ; Message-ID: <20060129151016.96211.qmail@web37109.mail.mud.yahoo.com> Received: from [150.101.221.238] by web37109.mail.mud.yahoo.com via HTTP; Sun, 29 Jan 2006 07:10:16 PST Date: Sun, 29 Jan 2006 07:10:16 -0800 (PST) From: Angelo Christou To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Shell Script Help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2006 15:10:18 -0000 Hello, I am running FreeBSD 6.0 with Bash as my shell. I am trying to automate a task and I have been reading a lot about Bash, but I haven't been able to get a script working. I have a program that I need to pass 3 variables. I have a text file called list.txt that has the variables separated by a space. There are hundreds of lines which is why I am trying to automate this. I'd like to learn shell too :) list.txt contains: bob home 9002 jim data 9005 sarah backup 4001 john temp 3001 (it's in the format var1 var2 var3) Running the following for each line is what I'm trying to do: myprogram bob home 9002 myprogram jim data 9005 and so on...... I need to pass the variables in list.txt to my program. From the docs on shell scripting I have been reading, I think I need to run something like this: # for (not sure what to put here) in list.txt;do myprogram $1 $2 $3;done Perhaps some experienced users might know how to do this? I am not even sure if I'm doing this the right way or if it can be done. Thank you very much for any help you can provide. Ang --------------------------------- Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail.