BashScripts.org
http://bashscripts.org/forum/

Please help make these 2 functions elegant!
http://bashscripts.org/forum/viewtopic.php?f=8&t=1359
Page 1 of 1

Author:  RickJWagner [ Fri Apr 22, 2011 6:33 pm ]
Post subject:  Please help make these 2 functions elegant!

Hi all,

I have a couple of lines in my .profile, but I'd like to publish them as an example for others and I think there's going to be a more elegant way to write them. My problem is sending the results of one function to another, I'm using a variable and it feels hackish.

Can you improve on these?


findF() { THEF=`find . -name $1`;export THEF; }
showF() { /usr/bin/gedit $THEF & }

Thanks for any suggestions!

Rick

Author:  canit0 [ Sat Apr 30, 2011 9:09 pm ]
Post subject:  Re: Please help make these 2 functions elegant!

So, Rick, what is it that your searching for and what are you searching?

I am pretty sure you can combine these into one function so, it is just that you want to search starting in your current path for a given string and display the sting in gedit?

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group • http://www.phpbb.com