jgigault / 42FileChecker

42FileChecker is a tiny bash script developed at 42 school for testing and checking files according to the rules of the subjects
Apache License 2.0
305 stars 56 forks source link

[Suggestion] Replace "open" by "xdg-open" (or propose) #116

Closed ghost closed 5 years ago

ghost commented 6 years ago

French: "open" ne fonctionne pas sur linux ou les BSD à jour de la façon dont le script l'utilise. Il ne fonctionne que sur les systèmes ayant des programmes "ancestraux" (tel qu'osx).

L'erreur suivante s'affichera:

Couldn't get a file descriptor referring to the console

Testé sur plusieurs plateformes, peut-être que remplacer "open" par "xdg-open" (ou proposer) serait une solution; il sagit d'un "open" tel qu'utilisé actuellement par le script. "see" serait aussi une option; il s'installe facillement et permetterait de donner une expérience "100%" en terminal plutôt que d'ouvrir le document de resultat dans un programme externe.

Voili voilou ;)

English "open" wont work on any up-to-date Linux or BSD by the way the script use it. It will only work on OSs that uses major outdated programs (like osx).

The folowing error will show:

Couldn't get a file descriptor referring to the console

Tested on many platforms, maybe remplacing "open" by "xdg-open" (or proposing) is a solution. It's an "open"'like and work the way the actual script is using "open". "see" may be an option too; it's easy to install and could give a 100% terminal experience instead of opening an other program to views results.

just saying ;)

Seluj78 commented 6 years ago

(I'll reply in english so that everybody can read it)

Hi there ! yes indeed, I've just tested on Ubuntu 16.04 the command you suggested, xdg-open and it worked wonderfully !

now about see, I couldn't get it working, nor install it. could you link me to the doc/website ?

If you're up to the challenge and want to do a PR replacing all open with xdg-open, be my guest ! If you won't I'll do it

ghost commented 6 years ago

I'm a bit in a rush right now. But I added it to my todo list. I won't mind if someone do it before me. I will not be able to contribute before the end the May if everything keep it's course.