Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readlink -f on BSD-like systems #573

Open
andrewstein opened this issue Jun 25, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@andrewstein
Copy link

commented Jun 25, 2018

On macos, I get the error

readlink: illegal option -- f
usage: readlink [-n] [file ...]

before the information printed by screenfetch....

$ screenfetch 
readlink: illegal option -- f
usage: readlink [-n] [file ...]
                               
                 -/+:.          xxxx@YYYYYY
                :++++.          OS: 64bit Mac OS X 10.13.5 17F77
               /+++/.           Kernel: x86_64 Darwin 17.6.0
       .:-::- .+/:-``.::-       Uptime: 11d 16h 55m
    .:/++++++/::::/++++++/:`    Packages: 60
  .:///////////////////////:`   Shell: bash 3.2.57
  ////////////////////////`     Resolution: 2880x1800 1920x1080 3840x2160
 -+++++++++++++++++++++++`      DE: Aqua
 /++++++++++++++++++++++/       WM: Quartz Compositor
 /sssssssssssssssssssssss.      WM Theme: Blue
 :ssssssssssssssssssssssss-     CPU: Intel Core i7-7700HQ @ 2.80GHz
  osssssssssssssssssssssssso/`  GPU: Intel HD Graphics 630 / Radeon Pro 560 
  `syyyyyyyyyyyyyyyyyyyyyyyy+`  RAM: 8583MiB / 16384MiB
   `ossssssssssssssssssssss/   
     :ooooooooooooooooooo+.    
      `:+oo+/:-..-:/+o+/-      
                               
@andrewstein

This comment has been minimized.

Copy link
Author

commented Jun 25, 2018

More info:

$ which readlink
/usr/bin/readlink
$ man readlink

STAT(1)                   BSD General Commands Manual                  STAT(1)

NAME
     readlink, stat -- display file status

SYNOPSIS
     stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]
     readlink [-n] [file ...]

DESCRIPTION
...
     When invoked as readlink, only the target of the symbolic link is
     printed.  If the given argument is not a symbolic link, readlink will
     print nothing and exit with an error.
...
@andrewstein

This comment has been minimized.

Copy link
Author

commented Jun 25, 2018

$ screenfetch -V
screenFetch - Version 3.8.0
Created by and licensed to Brett Bohnenkamper <kittykatt@kittykatt.us>
OS X porting done almost solely by shrx (https://github.com/shrx) and John D. Duncan, III (https://github.com/JohnDDuncanIII).

This is free software; see the source for copying conditions.  There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@darealshinji darealshinji added the osx label Jun 25, 2018

@zeilen zeilen referenced this issue Dec 6, 2018

Merged

macOS fix #602

@ningblue

This comment has been minimized.

Copy link

commented Jan 31, 2019

Excuse me, has this problem been fixed?

@muttmutt

This comment has been minimized.

Copy link

commented Feb 4, 2019

You can fix it on your own for now by replacing "readlink" with "stat" in the script.

elif readlink -f "$SHELL" | grep -q "busybox"; then
becomes
elif stat -f "$SHELL" | grep -q "busybox"; then

@darealshinji

This comment has been minimized.

Copy link
Collaborator

commented Feb 4, 2019

@muttmutt Can you make a pull request with such a fix?

@muttmutt

This comment has been minimized.

Copy link

commented Feb 4, 2019

@darealshinji It's actually already in process. See #602 for details.

@muttmutt

This comment has been minimized.

Copy link

commented Feb 4, 2019

I suspect we'll see a 3.8.1 version with this (and other) fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.