Does anyone take the "don't use cat" stuff seriously?
The useful use of cat
21–30 of 113 posts
Re: The useful use of cat
#22Re: The useful use of cat
#23cat all the things. i cat | grep and im not ashamed of it! cat | less - why not.? its not going to melt my pc more or less if i cat | more | less...
Re: The useful use of cat
#24Earlier quoted context omitted.
Whether there are formal examples or not, the thing you're doing during REPL driven programming is testing . It's just rapid, iterative and informal.
TDD refers to a specific kind of testing methodology, not just any and all testing. Manual testing is not TDD.
Re: The useful use of cat
#25Re: The useful use of cat
#26You can still just begin with <somefile instead of cat somefile |. Does it really matter? No, but I don’t think pointing out useful and concise built-ins is necessarily asinine.
Re: The useful use of cat
#27
this works in bash too, but if you're using zsh, there're a couple of nice shortcuts
on it's own works as more file
and > file
...
...
^D
allows you to put something into the file quickly without firing up the editor. Though > file
will give you nicer line editing experience.more zsh redirection tricks here: https://zsh.sourceforge.io/Doc/Release/Redirection.html#Mult...
Re: The useful use of cat
#28Does anyone take the "don't use cat" stuff seriously?
Specifically, it indicates some combination of:
1. isn't aware of processes/pipes
2. isn't aware of cat's "primary" functionality
3. isn't aware of shell input redirection
4. isn't aware that shell input redirection can be put before the command
Re: The useful use of cat
#29Re: The useful use of cat
#30My main use of cat is for clipboard pasting (if I can't leverage pbpaste or something more appropriate). If I want to get something into a file or get into a pipe as stdin `cat > file` or `cat | cmd`, paste, then end with cmd-D to send an EOF and terminate the cat. For files it circumvents "helpful" formatting you would get pasting into an editor.
pbpaste > file
and if you're using zsh, just > file
is sufficient, without cat