3 ms·
'cat > somefile' is my first instinct, but the while loop described allows for editing, rather than wholesale replacement.
by pronoiac 8y ago
'cat > somefile' is my first instinct, but the while loop described allows for editing, rather than wholesale replacement.
- tyingq 8y agoI was thinking of situations like described in the GP, where most external commands would be unavailable. Aside from what was described there, screwing up the shared libc is also common. Where you're left with a functional shell if you were logged in, but no external commands, except for /sbin/ stuff. The hack with echo mostly works, but will have issues with large files due to limits on arg length.