5 ms·
This is not much of a computational survivalism, if you need to install extra software on target machine. I mean, you might as well install Python. Do your ta
by jevgeni 7y ago
This is not much of a computational survivalism, if you need to install extra software on target machine.
I mean, you might as well install Python.
Do your task with PowerShell or DOS batch, and then this might cut it as computational survivalism on that box.
EDIT: Here, the solution to the author's problem without needing to pull a *nix tool chain in.
((Get-Content "<file name>").ToCharArray() `
| Where-Object { $_ -eq '<the character that you need>' } `
| Measure-Object).Count
- AnIdiotOnTheNet 7y agoI mostly really like PowerShell, and it works for Windows where the CLR is now part of the OS. I do wish there was a Linux equivalent but lighter weight, but so far all I've seen are attempts to shoe-horn existing unix programs into that model. I wish there was a ground-up rewrite, an entire environment that used a PowerShell-like object model with no legacy dependencies.
- jevgeni 7y agoYes, you are right. It would be a cool thing to have - an object bash. 8O
- rapind 7y agoNu Shell looks promising (inspired by PowerShell). https://github.com/nushell/nushell https://github.com/nushell/nushell
- AnIdiotOnTheNet 7y agoEh, it looks decent, but it isn't really what I want. For one, its cross-platform nature means it has eschewed greater integration with the system. One of the great strengths of PowerShell is how it treats pretty much every system interface as the same kind of object as everything else. Linux has these weird text based interfaces in /sys/ and /proc/ that it'd be nice to wrap. Secondly it looks like it depends on a fair amount of typical userland being available. It'd prefer something I could slap on top of busybox and be done. Something that only depended on the kernel. But, maybe with some tweaking...
- geophile 7y agoTake a look at Object Shell: https://github.com/geophile/osh https://github.com/geophile/osh
- AnIdiotOnTheNet 7y agoRequires Python, hardly meets my personal criteria for 'lightweight'.
- herewulf 7y agoHave you seen elvish[1]? Structured data shell that's just a single Go binary. [1]: https://elv.sh https://elv.sh
- AnIdiotOnTheNet 7y agoCloser, but there's no way to interface with it from the outside world. If I want to add a tool I have to awkwardly pass data to and from it using to/from-json on the shell side.
- deleted 7y ago[deleted]