Skip to main content
edited body
Source Link
user242114
  • 121
  • 1
  • 1
  • 4

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex.

grepecho date | sh - 

prints out the date.

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex.

grep date | sh - 

prints out the date.

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex.

echo date | sh - 

prints out the date.

Bumped by Community user
added 8 characters in body; edited tags
Source Link
jesse_b
  • 41.6k
  • 14
  • 108
  • 163

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex. grep date | sh - prints

grep date | sh - 

prints out the date.

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex. grep date | sh - prints out the date.

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex.

grep date | sh - 

prints out the date.

Source Link
user242114
  • 121
  • 1
  • 1
  • 4

what does "sh -" mean?

I know that sh just calls the default shell, so "bash -" means the same. But can someone explain the syntax to me. I tried looking in the bash manual, but couldn't find it. I came across this because I wanted to execute the output of a command. Ex. grep date | sh - prints out the date.