hr
hr copied to clipboard
make script posix compliant
This makes hr
work in the busybox environment in my Alpine Linux container.
Hey @txgk, I appreciate the PR, I think I'd rather keep hr as a bash script to make it easier to work with, but I was testing your changes and it doesn't seem to work in Alpine still, here's the steps I used.
With this Dockerfile:
FROM alpine
RUN apk update && apk add gcc make
COPY . /tmp
WORKDIR /tmp
RUN make install
Then running hr inside the container, I'm getting "tput: not found" is tput perhaps not part of ash
? In which case, hr
as it is would need a lot more work to make it work with ash.
Let me know if I am making any mistake in my testing.
Hello!
I think I'd rather keep hr as a bash script to make it easier to work
That's fine, no problem.
Then running hr inside the container, I'm getting "tput: not found" is tput perhaps not part of
ash
?
The thing is that tput is not a part of bash
either. In Linux distributions this utility is provided by ncurses usually.
hr
as it is would need a lot more work to make it work with ash.
I don't think so. I'd say bash variant and POSIX variant aren't that different, it's just that you get portability with latter.
Thanks for the reply @txgk!
The thing is that tput is not a part of bash either. In Linux distributions this utility is provided by ncurses usually.
Oh right, I wasn't aware, so then my test didn't work because the docker container did not have ncurses installed, I forgot/didn't realise that hr actually had that dependency, I'm going to take a second look at these changes then :+1:
Take your time :D