Date: Wed, 11 Mar 1998 15:22:26 -0800 From: Studded <Studded@dal.net> To: greg@merrimack.edu Cc: FreeBSD Hackers <hackers@FreeBSD.ORG>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: Re: for loop at your command prompt Message-ID: <35071CB2.A4620F21@dal.net> References: <3506FEC1.7D9312B2@merrimack.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35071CB2.A4620F21>
