Command not found when using readProcessStdout

Hello.

I’m trying to run some commands using System.Process.Typed.readProcessStdout. Only issue is, it seems to be defaulting to /bin/sh, which doesn’t have the binary I need to run the command. FWIW I’m using NixOS, and installed the package system-wide. It does exist when I try to run it in shell so I don’t think a bad install is the problem. I’m guessing that the nix store isn’t in the PATH of /bin/sh?

/bin/sh: <PACKAGE_NAME>: command not found

I’d appreciate any pointers!

/bin/sh is hardcoded. I guess you are using the shell smart constructor. That won’t work if /bin/sh isn’t a shell command interpreter. Best to find some way of using proc.

/bin/sh is available on nixos, I think the problem is that the <PACKAGE_NAME> program cannot be found.

Ah yes, I misread the question!

@sekun, what command do you run to run this binary from the command line? Can’t you use the same one with readProcessStdout?

@tomjaguarpaw I tried it with docker but it doesn’t recognize it.

That won’t work if /bin/sh isn’t a shell command interpreter. Best to find some way of using proc.

1 Like