Skip to main content
respond to comment
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 67
  • 115

I am not 100% sure, but I don't think these command set, if can take input from stdin.

I looked up on https://github.com/fish-shell/fish-shell/issues/6173

And it seems that the test in fish is a little odd. I could not work it out. However this works.

if /usr/bin/test (somethingsomeCommand) = "hello" echo t else echo f end 

in bash it is this

if test "$(somethingsomeCommand)" = "hello" then echo t else echo f fi 

There must be a better answer. But this worked.

I am not 100% sure, but I don't think these command set, if can take input from stdin.

I looked up on https://github.com/fish-shell/fish-shell/issues/6173

And it seems that the test in fish is a little odd. I could not work it out. However this works.

if /usr/bin/test (something) = "hello" echo t else echo f end 

in bash it is this

if test "$(something)" = "hello" then echo t else echo f fi 

There must be a better answer. But this worked.

I am not 100% sure, but I don't think these command set, if can take input from stdin.

I looked up on https://github.com/fish-shell/fish-shell/issues/6173

And it seems that the test in fish is a little odd. I could not work it out. However this works.

if /usr/bin/test (someCommand) = "hello" echo t else echo f end 

in bash it is this

if test "$(someCommand)" = "hello" then echo t else echo f fi 

There must be a better answer. But this worked.

Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 67
  • 115

I am not 100% sure, but I don't think these command set, if can take input from stdin.

I looked up on https://github.com/fish-shell/fish-shell/issues/6173

And it seems that the test in fish is a little odd. I could not work it out. However this works.

if /usr/bin/test (something) = "hello" echo t else echo f end 

in bash it is this

if test "$(something)" = "hello" then echo t else echo f fi 

There must be a better answer. But this worked.