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

[no subject]



echo "/foo/bar/shi/tia.txt" | sed -e 's,[^/]*$,,g'


Thus spake James Sumners (james.sumners at gmail.com):

> I need to get the base path of a filename. For example, if I have
> "/path/to/some/random/file.ext" I need to trim off "file.ext" so that
> I am left with "/path/to/some/random/". However, the filename could
> contain spaces and other odd characters. Any suggestions?
> 
> -- 
> James Sumners
&gt; <a  rel="nofollow" href="http://james.roomfullofmirrors.com/";>http://james.roomfullofmirrors.com/</a>
&gt; 
&gt; &quot;All governments suffer a recurring problem: Power attracts
&gt; pathological personalities. It is not that power corrupts but that it
&gt; is magnetic to the corruptible. Such people have a tendency to become
&gt; drunk on violence, a condition to which they are quickly addicted.&quot;
&gt; 
&gt; Missionaria Protectiva, Text QIV (decto)
&gt; CH:D 59
&gt; _______________________________________________
&gt; Ale mailing list
&gt; Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>

:wq!
---------------------------------------------------------------------------
Robert L. Harris                     | GPG Key ID: E344DA3B
                                         @ x-hkp://pgp.mit.edu
DISCLAIMER:
      These are MY OPINIONS             With Dreams To Be A King,
       ALONE.  I speak for              First One Should Be A Man
       no-one else.                       - Manowar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00533" href="msg00533.html">[ale] Looking for a one line script</a></strong>
<ul><li><em>From:</em> james.sumners at gmail.com (James Sumners)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00534.html">[ale] new hardware problems</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00536.html">[ale] Looking for a one line script</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00533.html">[ale] Looking for a one line script</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00536.html">[ale] Looking for a one line script</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00535"><strong>Date</strong></a></li>
<li><a href="threads.html#00535"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>