On Tue, 2020-12-22 at 09:29 +0100, Stefan G. Weichinger via samba wrote:> > And maybe "#!/bin/sh" ... I still don't see why it works from the > bash > > and not in the script (we need it as cron job in the end).That will be it. /bin/sh and /bin/bash are quite different on Debian- based systems. Use #!/bin/bash and it should be much more like your interactive shell. Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba
Stefan G. Weichinger
2020-Dec-22 08:53 UTC
[Samba] Shutting down a remote PC via "net rpc"
Am 22.12.20 um 09:50 schrieb Andrew Bartlett:> On Tue, 2020-12-22 at 09:29 +0100, Stefan G. Weichinger via samba > wrote: >> >> And maybe "#!/bin/sh" ... I still don't see why it works from the >> bash >> >> and not in the script (we need it as cron job in the end). > > That will be it. /bin/sh and /bin/bash are quite different on Debian- > based systems. > > Use #!/bin/bash and it should be much more like your interactive shell.We use "#!/bin/bash" already and it doesn't work, so I wonder if "#!/bin/sh" might work. I wasn't clear above.
Stefan G. Weichinger
2021-Jan-13 12:29 UTC
[Samba] Shutting down a remote PC via "net rpc"
Am 22.12.20 um 09:53 schrieb Stefan G. Weichinger via samba:> Am 22.12.20 um 09:50 schrieb Andrew Bartlett: >> On Tue, 2020-12-22 at 09:29 +0100, Stefan G. Weichinger via samba >> wrote: >>> >>> And maybe "#!/bin/sh" ... I still don't see why it works from the >>> bash >>> >>> and not in the script (we need it as cron job in the end). >> >> That will be it.? /bin/sh and /bin/bash are quite different on Debian- >> based systems. >> >> Use #!/bin/bash and it should be much more like your interactive shell. > > We use "#!/bin/bash" already and it doesn't work, so I wonder if > "#!/bin/sh" might work.It works with "#!/bin/sh" ... and the length of the comment (with "-C") seems to play a role (or maybe special chars like "umlauts"?) At least my customer reports that.