From owner-freebsd-questions Wed Mar 11 15:23:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA06729 for freebsd-questions-outgoing; Wed, 11 Mar 1998 15:23:37 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from dt050ndd.san.rr.com (root@dt050ndd.san.rr.com [204.210.31.221]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA06637; Wed, 11 Mar 1998 15:22:39 -0800 (PST) (envelope-from Studded@dal.net) Received: from dal.net (dougdougdougdoug@localhost [127.0.0.1]) by dt050ndd.san.rr.com (8.8.8/8.8.8) with ESMTP id PAA04701; Wed, 11 Mar 1998 15:22:26 -0800 (PST) (envelope-from Studded@dal.net) Message-ID: <35071CB2.A4620F21@dal.net> Date: Wed, 11 Mar 1998 15:22:26 -0800 From: Studded Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 2.2.6-BETA-0310 i386) MIME-Version: 1.0 To: greg@merrimack.edu CC: FreeBSD Hackers , FreeBSD Questions Subject: Re: for loop at your command prompt References: <3506FEC1.7D9312B2@merrimack.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This isn't a hacker's question, so I'm sending it to -questions where you should follow it up if need be. Greg Fraize wrote: > > can someone please tell me how I could do a > for loop at my shell prompt... Assuming that you are using either bash (yay :) or /bin/sh, all you need to do is type it in. You'll get a secondary prompt till you type in 'done' and then your little command line will run. Here's an example of something that I use all the time, bonus points if you can tell me what it does. :) bash$ for FOO in `ls /usr/local/bin/*ntp*`; do > ln -s $FOO ${FOO##*/} > done You could also type it in all on one line, but I think it's more fun to do it a line at a time. :) It's also easier to see what's happening. Good luck, Doug -- *** Chief Operations Officer, DALnet IRC network *** *** Proud operator, designer and maintainer of the world's largest *** Internet Relay Chat server. 5,328 clients and still growing. *** Try spider.dal.net on ports 6662-4 (Powered by FreeBSD) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message