Re:GoAWK: an AWK interpreter written in Go
by yolo1 on Sunday November 18, 2018 @12:49AM
(#18479046)
It's kinda nuts how far the unixy idea of "just streams of text" has gotten us.
As much as I agree that the tooling is, object-based tools would be much nicer.
for i in `ls`; do echo $i.size; done;
versus ls -la | awk '{print $5}'
I know which I'd prefer.
Re:GoAWK: an AWK interpreter written in Go
by cyphar on Sunday November 18, 2018 @02:45AM
(#18479308)
This is something that reiserfs was trying to solve (though unfortunately we all know what happened with Hans and Nina Reiser), so most of the ideas have been left on the table.
But yeah, the solution he proposed was to start combining different information namespaces (such as the "metadata" namespace that you are alluding to) into the filesystem namespace, as well as allowing for the filesystem to be pluggable so people could write databases that could be searched with the filesystem.
So your example would look like
for i in "$(ls)"; do echo $i/..../size; done
And you could do something like echo 1000 | tee */..../uid
Which would be equivalent to a chown.
Re:GoAWK: an AWK interpreter written in Go
by shitloadofbooks on Sunday November 18, 2018 @01:46AM
(#18479179)
PowerShell is an extremely nice, cross-platform option. Most people are discouraged by the overly long command names (get-childitem and the like), but there are 3 letter aliases (e.g gci) for a lot of the common ones and its really nice.
The second, because when the first fails, you're left with an ls command which is spewing some binary format you can't read without... wait for it... the tool which just failed.
I'd like to ensure my tools are all speaking a format which is too simple to ever fail.
Re:GoAWK: an AWK interpreter written in Go
by forkandwait on Sunday November 18, 2018 @01:54AM
(#18479198)
I think you picked the only nice example of powershell in the entire universe (yuck!). Also -- guess which script is shorter....
Re:GoAWK: an AWK interpreter written in Go
by tejtm on Sunday November 18, 2018 @02:40PM
(#18482122)
for unixy tools ... well there are lots more,
some have made concessions to be less particular as to who considers them nice or friendly. `ls` is very much in the
public relations camp, the flamboyant front man, first point of contact. Behind 'ls' is 'stat' which is more a unixy text stream tool's tool than the human friendly `ls`
stat -c "%s %n" *
Re:GoAWK: an AWK interpreter written in Go
by paavoova on Sunday November 18, 2018 @03:12AM
(#18479353)
No, that's awful if you consider its implications. Just do:
for i in *; do du -bs "$i"; done
Re:GoAWK: an AWK interpreter written in Go
by masklinn on Sunday November 18, 2018 @06:36AM
(#18479886)
> for i in *; do du -bs "$i"; done
du: illegal option -- b
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file …]
cool
Re:GoAWK: an AWK interpreter written in Go
by kccqzy on Sunday November 18, 2018 @01:41AM
(#18479168)
Sounds like you will like PowerShell.
Nobody likes PowerShell. It manages to be the worst of both worlds.
Re:GoAWK: an AWK interpreter written in Go
by yolo1 on Sunday November 18, 2018 @02:39AM
(#18479299)
I wasn't aware that people hated it. I very rarely struggle through it (learning curve related, probably) but the objective behavior is something I wish Linux tools would move towards.
Re:GoAWK: an AWK interpreter written in Go
by bakoo on Sunday November 18, 2018 @09:39AM
(#18480565)
It may well be uglier than sin's really ugly cousin, but if you are stuck managing Windows environments, it's a god damned life saver.
Honestly, I'd much rather have seen it be a bunch of console-oriented convenience libs for .NET and focus on making a good REPL console for .NET languages.
Re:GoAWK: an AWK interpreter written in Go
by unixhero on Sunday November 18, 2018 @01:15AM
(#18479111)
Wait a minute. Bash has nice operators like .size ?
Omg
It's kinda nuts how far the unixy idea of "just streams of text" has gotten us.