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)
-   -   fast unix question (https://gfy.com/showthread.php?t=501872)

Zester 08-10-2005 08:25 AM

fast unix question
 
I have this string:

Code:

a = "/home/blackgeer/1022/index.html"
how do I chop off the "index.html" part and only keep the "/home/blackgeer/1022/" part ?

UltraSonic 08-10-2005 08:26 AM

Quote:

Originally Posted by Zester
I have this string:

Code:

a = "/home/blackgeer/1022/index.html"
how do I chop off the "index.html" part and only keep the "/home/blackgeer/1022/" part ?

Are you serious? :winkwink:

tgpmakers 08-10-2005 08:28 AM

if(a=m~{(.*?)index\.html})
print $1;
Providing you using Perl. :thumbsup

Zester 08-10-2005 08:29 AM

Quote:

Originally Posted by garymayor
if(a=m~{(.*?)index\.html})
print $1;
Providing you using Perl. :thumbsup

no i don't.
this is done in an .SH file

I know how to do this in perl, i'm no sysadmin by the way

grumpy 08-10-2005 08:39 AM

try an editor

jerzeemedia 08-10-2005 08:40 AM

a = "/home/blackgeer/1022/index.html"

echo $a|sed 's/index\.html//'

Radiate 08-10-2005 09:56 AM

format c:


All times are GMT -7. The time now is 01:24 PM.

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