News for hackers. Stuff that matters.
Re:A Terminal Case of Linux by samsquire on Monday May 29, 2023 @02:04PM (#36116353)
You can put shell file redirections such as "< file" at the beginning of the line.

In bash, type:

   < /etc/resolv.conf grep nameserver
(That < is not a prompt, that's the less than symbol)
Re:A Terminal Case of Linux by tolciho on Monday May 29, 2023 @02:11PM (#36116409)
Sometimes you can prefix with "< file". Sometimes, not so much.

< /etc/passwd while IFS= read line || [ -n "$line" ]; do printf '%s\n' "$line"; done

Meanwhile, in ZSH...

Meanwhile, in languages that do not need IFS= and || [ -n "$line" ] checks...

Re:A Terminal Case of Linux by kzrdude on Monday May 29, 2023 @02:26PM (#36116533)
Nice, I learned something and thank you
Re:A Terminal Case of Linux by ilyt on Monday May 29, 2023 @04:25PM (#36117694)
aliasing c to cat still requires less keystrokes
Re:A Terminal Case of Linux by antonvs on Monday May 29, 2023 @10:10PM (#36120433)
But in a multi-step pipe, that’s still asymmetric and to me, less natural as a result.

    cat f | grep nameserver | otherproc…
…is more consistently compositional.