Re: getting rid of the path

From: Toshi (toshi_at_lemon.com)
Date: 09/04/03


Date: Wed, 03 Sep 2003 20:40:19 -0400

Chris F.A. Johnson wrote:

> On Wed, 03 Sep 2003 at 21:55 GMT, Toshi wrote:
>
>>Since the file paths are in a file, I tried to redirect that files to
>>baseanme and redirect it to another file (because it is my ultimate
>>goal. It didn't work. So I tried :
>>
>>for f in filewithpath ; do basename "$f" >> filewitoutpath ; done
>>
>>same error
>>
>>usage: basename string [suffix]
>>
>>What is the right way?
>
>
> while read f
> do
> basename "$f" ## or: echo ${f##*/}
> done < filewithpath > filewithoutpath

It does work! By the way I don't understand the meaning of those
" ##"

I know that loops are known to be slow. Is there a way to do without them?

Thank you in advance!



Relevant Pages

  • Re: redirect to start of file
    ... Chris F.A. Johnson wrote: ... Since>> apends to the end of a file, how can I redirect to the start ...
    (comp.os.linux.misc)
  • Re: uploading a file and forms
    ... ..oO(Scott Johnson) ... or redirect to a different page such as a confirmation page. ... You can also redirect to the same page after a successful POST. ...
    (comp.lang.php)
  • Re: getting rid of the path
    ... On Wed, 03 Sep 2003 at 21:55 GMT, Toshi wrote: ... > Since the file paths are in a file, I tried to redirect that files to ... done < filewithpath> filewithoutpath ...
    (comp.unix.shell)
  • Re: Cant save MP3 file loaction changes/ Wont Play
    ... information from the old file path, thats the problem, some of the file paths are incorrect and when I redirect it and put in the correct path, those changes won't save, even though the file paths in the wmp10 library are correct. ... And I've also tried tools>search for media files, and that has no effect either, I've completely deleted everything and started over (except for the playlists of course), and nothing saves the changes. ...
    (microsoft.public.windowsmedia.player)
  • Re: Successful system call output going to error log
    ... can redirect it to stdout or /dev/null: ... Gracias Alvaro. ... Redirected it to stdout and now its working ... The file paths weren't an issue. ...
    (comp.lang.php)