ahh

~$ which cat
  • lokalhorst@feddit.org
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    10 hours ago

    If I just want to look at the file, is there a better way than cat foo.txt? I guess I can’t just do < foo.txt

    • dan@upvote.au
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      6 hours ago

      Admittedly 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).