Re: stupid bash question

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



On Aug 15, 2012, at 5:11 PM, fred smith wrote:

> how about something (seemingly simple) like this:
> 
> find out how many there are:
> 
> 	count=`ls * | grep -c .MOV$`
> 
> then diagnose the result:
> 
> 	if [ $count -ge 1 ]
> 		then
> 		do your stuff here
> 	else
> 		echo oops. nothing to do!
> 	fi
> 
> of course, there are pitfalls... we're asuming that there are only FILES
> that would match the pattern ".MOV", no directories.
----
very effective for my purposes, thanks.

Craig
_______________________________________________
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