GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   anyone know perl or sed solution for this? (https://gfy.com/showthread.php?t=1041116)

fris 10-09-2011 09:17 AM

anyone know perl or sed solution for this?
 
Code:

for f in *.txt; do
desc=`echo ${f%.*} | sed 's/-/ /g'`
gist --description \"$desc\" $f
done

bascially im trying to combine line 2 and 3 into 1 line without it stripping out --

it takes file-name-here.txt and uses the description by stripping - with spaces and uses that as the description for the upload to gist.github.com

so bascially im trying to ignore -- (description).

fris 10-09-2011 09:37 AM

nevermind i figured it out without sed

Code:

for f in *.txt; do
b=${f%.*};
gist --description \"${b//-/ }\" "$f"
done;


devilspost 10-09-2011 09:41 AM

Way to go :)


All times are GMT -7. The time now is 10:56 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123