shark_byte@lemmy.zip to Programmer Humor@programming.dev · 18 hours agoLinux Catlemmy.zipexternal-linkmessage-square50linkfedilinkarrow-up1312arrow-down16file-text
arrow-up1306arrow-down1external-linkLinux Catlemmy.zipshark_byte@lemmy.zip to Programmer Humor@programming.dev · 18 hours agomessage-square50linkfedilinkfile-text
minus-squaredan@upvote.aulinkfedilinkarrow-up9·edit-23 hours agoAdmittedly I still use cat for this. This also works too, but it’s more verbose: echo "$(<foo.txt)" It’s mentioned in the Bash man pages: The command substitution $(cat file) can be replaced by the equivalent but faster $(< file). EDIT: I was just informed that simply <foo.txt works too.
minus-squarenot_IO@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up1·4 hours agohow in the world is this not a useless use of echo and equivalent to <foo.txt
minus-squaredan@upvote.aulinkfedilinkarrow-up2·3 hours agoOK, TIL you can just do <foo.txt. I didn’t think that worked. Thanks!
Admittedly I still use
catfor this.This also works too, but it’s more verbose:
echo "$(<foo.txt)"It’s mentioned in the Bash man pages:
EDIT: I was just informed that simply
<foo.txtworks too.how in the world is this not a useless use of echo and equivalent to
<foo.txtOK, TIL you can just do
<foo.txt. I didn’t think that worked. Thanks!