Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • How to omit the Pseudo-terminal will not be allocated because stdin is not a terminal. it produces? Commented Jan 25, 2020 at 7:26
  • 1
    @annahri, you'd only get that message if you used -t. You never want to use -t with ssh unless you want to run an interactive visual command like vi/mutt... on the remote host. It would definitely not make sense under the condition "no command ever reads stdin" which I stated. See also Why is this binary file transferred over "ssh -t" being changed? Commented Jan 25, 2020 at 7:31
  • This works great! Great explanation from you. Sadly I can only up vote once. Thanks! Commented Jan 25, 2020 at 7:42
  • Could you also explain why <"$file" sed '/something/!d; s/.*="\(.*\)"/\1/; y/ /-/' runs successfully when there's no pipe? Commented Jan 25, 2020 at 8:00
  • @annahri, pipes are to interconnect two commands running concurrently with the output of one fed into the input of the other. cat is a command to concatenate files. It doesn't make sense to use it for a single file. Here we make sed's stdin the file open in read-only mode (with <) directly which makes a lot more sense. You may not be used to redirections being put at the start of the command, but redirections can be put anywhere for simple commands: <input sed script > output is the same as sed script < input > output or sed < input script > output Commented Jan 25, 2020 at 8:03