tj/bm

Wrong readlink

Closed this issue · 13 comments

I'm getting the following response on different invocations of bm:

readlink: illegal option -- m

Might I have some different version of this command?
I'm running on OSX 10.11.3

Hi,

Maybe I'll say something wrong, but on osx, readlink is answer the same thing as stat.

Which commit did yout test ?

As I currently have not a Macintosh, may I suggest you test this commit f79c10c. Tell me if it works and I'll include it in the master branch.

Thanks.

readlink is the same as stat, indeed.
I don't seem to be able to checkout that commit. I don't see any other branch than the master branch either.

I made the change from that commit manually and the readlink message is gone.
Now I (still) get the warning: Your URL seems invalid 'http://github.com'. Use -F to force. when issuing the command: bm -a 'http://github.com' or bm -a http://github.com. This might be a different issue though.

Indeed i pushed it in my repo, instead of the tj one.

The message you now have is related to sed.
Could you execute the following command and post me the result ?
sed 's/^[[:space:]]*\(f\|ht\)tps*:\/\/.*$/totoz/' <<< "http://github.com"
Thanks

➜  ~ sed 's/^[[:space:]]*\(f\|ht\)tps*:\/\/.*$/totoz/' <<< "http://github.com"
http://github.com

I guess that's as expected?

Unfortunately not. You should have a totoz instead.

Ah, I see. The pipe doesn't seem to be working; this works:

➜  ~ sed 's/^[[:space:]]*\(ht\)tps*:\/\/.*$/totoz/' <<< "http://github.com"
totoz

Indeed, from http://unix.stackexchange.com/questions/13711/differences-between-sed-on-mac-osx-and-other-standard-sed we could read :

GNU sed interprets |, +, and ? in BRE but OS X's sed and POSIX sed don't. (, ), {, and } are POSIX BRE.

I replace the sed call by a Bash check. Could you try 7ed4f76 (branch https://github.com/Flyounet/bm/tree/issue18-readlink in my repo) ?

I suspect there will be other issue with sed (eg. if you set _BM_PRINT_SCHEME to false).

May I suggest we close this entry, and if other bug(s) came, we open another entry ?

Yes, this issue should be closed. The readlink issue is resolved in that branch.

v0.6.2 7c6065f has been published with this Fix.