Need help for basename
I have tried to run this:
Lets say i have two files in the current folder: file1.xyz file2.xyz Quote:
Quote:
Quote:
Quote:
|
I have basename version 8.25 and your command works fine.
Possible that this is a bug, however also possible is something else is wrong, my FSF statement shows (C) 2016 versus 2010. |
The 8.4 version of basename does not support the "-s" option.
|
Code:
DESCRIPTION |
What does this give you:
Code:
find . -name "*.xyz" -exec basename {} .xyz \; |
TenTenths example should work as your own output gave the exact same example:
Code:
basename include/stdio.h .h Output "stdio". |
Quote:
So i guess i would need to find a workaround with the -exec |
You can use find with xargs. Leave out the -exec clause and use -print0 instead. Then for xargs use -0 or --null.
Be sure to check the manual pages for both periodically so that they start to become familiar. Code:
man find |
you may find this http://www.thegeekstuff.com/2013/12/xargs-examples/ useful (or you can find similar pages too)
|
Quote:
http://mywiki.wooledge.org/UsingFind...and_-exec_.2B- |
Quote:
|
Oh, i read that.
And truth to be told: i am not that much in the subject that i could advise or explain it at all. My post was rather focused at the OP, so he knows that some folks have strong opinions against usage of xargs ( while, like said, i for one sure can't say much about it). in short: it really was a side-note only. |
jrffrey
why are you using a old operating system from 2010 courutils 8.4 is 7 years old http://ftp.gnu.org/gnu/coreutils/?C=M;O=D |
Red Hat Enterprise Linux 6 is fully supported until November 30, 2020, and uses coreutils-8.4. A lot of people are using it.
|
All times are GMT -5. The time now is 08:13 AM. |