ahh

~$ which cat
you are viewing a single comment's thread
view the rest of the comments
[–] 18 points 1 week ago* (last edited 6 days ago) (4 children)

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

  • source
  • parent
  • hideshow 8 child comments
  • [–] 13 points 6 days ago* (last edited 6 days ago) (1 child)

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

    EDIT: I was just informed that simply <foo.txt works too.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 6 days ago (1 child)

    how in the world is this not a useless use of echo and equivalent to <foo.txt

  • source
  • parent
  • hideshow 2 child comments