Well thanks, I knew this solution, but it only works if you know the
extension of the file. What I'm looking for is something that remove any
extension suffix, whatever it is. So, your last line should give "myfile"
alone.
2013/6/17 Stestagg <stest...@gmail.com>
> One simple method would be to use basename:
>
> nameis=(basename $dataset .foo)
>
> this will perform the following,
>
> if $dataset = myfile then $nameis = myfile
> if $dataset = myfile.foo then $nameis = myfile
> if $dataset = /path/to/myfile.foo then $nameis = myfile
> if $dataset = /path/to/myfile.bar then $nameis = myfile.bar
>
> so provided you don't need absolute paths, this is simple.
>
> Steve
>
>
> On Mon, Jun 17, 2013 at 9:22 AM, aurelien coillet <acoil...@gmail.com>wrote:
>
>> Hi,
>>
>> How can I perform suffix removal as this (bash) command:
>>
>> nameis=${dataset%.*}
>>
>>
>> if dataset is a filename with extension (say foo.txt), nameis will only
>> contain "foo".
>> Is there a way to do that with fish?
>>
>> Thanks,
>>
>> --
>> Aurélien Coillet
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Fish-users mailing list
>> Fish-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>
>>
>
--
Aurélien Coillet
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users