Sample Header Ad - 728x90

"Here Document" as a Single Line Command?

5 votes
3 answers
2243 views
I have this command to run a checksum in some software I want to install: echo "85762db0edc00ce19a2cd5496d1627903e6198ad850bbbdefb2ceaa46bd20cbd install.sh" | sha256sum -c But I would like to use it with the sha256sum command *first*. So we have that using heredoc: sha256sum -c << EOF 85762db0edc00ce19a2cd5496d1627903e6198ad850bbbdefb2ceaa46bd20cbd install.sh EOF But now I would like this to be all on one line... So I tried: sha256sum -c << EOF ; 85762db0edc00ce19a2cd5496d1627903e6198ad850bbbdefb2ceaa46bd20cbd install.sh ; EOF And it doesn't work. But _shouldn't_ it work if the semicolon ; means "we're going to run another command"? Can we get it in that order, but written a different way to work on one line? If not, why can't we tell it what to do on each multiple line, but on one line?
Asked by Cnnewb (51 rep)
Mar 29, 2024, 07:38 PM
Last activity: Apr 1, 2024, 08:34 AM