Re: [OT] Simple Shell Script (while loop)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Jun 03, 2009 at 08:44:29AM +0100, James Bensley wrote:

	There are many ways to do this; building on your code
	snippet it would be:

#!/bin/bash
find ./ -maxdepth 1 -type d | while read FOLDER
do
	if [ "$FOLDER" = "./not_this_folder_oh_no!" ]; then
		continue
	fi
	<otherwise do some magic here>
done

"continue" is treated as a reloop operator; and you should quote strings.





							John

-- 
"I'm sorry but our engineers do not have phones."
As stated by a Network Solutions Customer Service representative when asked to
be put through to an engineer.

"My other computer is your windows box."
                                     Ralf Hildebrandt
<sxem> trying to play sturgeon while it's under attack is apparently not fun.

Attachment: pgp7HmtzKsY1I.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux