5 ms·
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.
by yolo1 8y ago
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.
- unixhero 8y agoWait a minute. Bash has nice operators like .size ? Omg
- stevekemp 8y agoNo, that was the point of the parent - that it would be nicer if we did have some object-layer, rather than processing (unstructured) text in pipelines. Losing meta-data at each step.
- kccqzy 8y agoSounds like you will like PowerShell.
- Pxtl 8y agoNobody likes PowerShell. It manages to be the worst of both worlds.
- yolo1 8y agoI 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.
- bakoo 8y agoIt 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.
- Pxtl 8y agoHonestly, 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.
- shitloadofbooks 8y agoPowerShell 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.
- forkandwait 8y agoI think you picked the only nice example of powershell in the entire universe (yuck!). Also -- guess which script is shorter....
- cyphar 8y agoThis 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.
- paavoova 8y agoNo, that's awful if you consider its implications. Just do: for i in *; do du -bs "$i"; done
- masklinn 8y ago> 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
- deleted 8y ago[deleted]
- msla 8y agoThe 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.
- tejtm 8y agofor 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" *