I often use following one liner in ruby to see the details of my PATH. What would be the cleanest version of it in julia with less typing.
ruby -e 'puts ENV["PATH"].split(":").sort' or longer version ruby -e 'ENV["PATH"].split(":").sort.each { |path| puts path }'
This one line code basically splits PATH environment variable based on : which creates a array of strings, sorts it and displays it. I sometimes add .sort.reverse reverse call after sort.
My julia version
julia -e 'foreach(println, split(ENV["PATH"],":") |> sort )' or julia -e 'foreach(println, sort(split(ENV["PATH"],":")))'
I do not know if function composition can be used in one line code written on terminal.
Note, to get the circle, meaning function composition, from math, you type that, then press TAB. I just recalled this possibility, that I had never used in Julia, and a long time ago in math⦠and there are more ways even with it, see the help, but again, didnāt get print. to work. Maybe it should (bug or to-be-implemented) or already can?
Unfortunately this code requires julia console. I wonder if there is a way to write symbolic characters in literal way without needing latex symbols which requires julia aware environment.