0

I use bash 4.4.

How do I print the a file to command line.

For example,

$ printf "HELLO" > file
$ my-command file
$ HELLO

where the HELLO in the last line shows after the second command is run.

A similar method is

$ history
1 ls
2 cd ~
$ !2:p
$ cd ~

which will show the historical command in the next command line without executing it.

Vito Chou
  • 291

0 Answers0