Closed takitakitanana closed 10 months ago
I'm sorry, but this is not right. In this case is the shell that performs the fire read, not tr
, in fact sudo tr
doesn't allow you to read root files; here tr
merely acts as cat
.
From the other #430:
Would a PR to add this to 'ash' as read-file (UNIX shell), for example, work ?
Well, yes, but it has to involve shell builtins only, take a look at bash
for example.
Does this make sense?
Hello,
Here's an alternative approach for reading files, utilizing shell builtin commands along with the
tr
binary. It's useful in scenarios where common file-reading utilities likecat
might be restricted or monitored.The read file approach is binary-safe. The use of a subshell is needed to avoid shutting down the main interactive shell when
exec
is done.Proof of Concept:
This submission builds on the previous PR #430 . I've taken the feedback and made tweaks for a better fit.
Thank you, taki