-2

I have 2 scripts, script.sh:

./mount.sh

and, mount.sh:

mount /dev/sdb4 /mnt/mountpoint

script.sh does some steps and invokes mount.sh which mounts the disk that is sdb. The mount.sh script works fine, but, when invoked from the scripts.sh script it fails to mount. I do not have the error messages, if any, from invoking mount.sh from scripts.sh. But, what possible reason could there be for that to fail?

Kusalananda
  • 14,885
  • 3
  • 41
  • 52
silvermangb
  • 355
  • 2
  • 11
  • 1
    There is no reason for it to fail. The bits first script that you don't show might do something wrong. Also an error message would be _exceedingly_ good to see. – Kusalananda Jul 28 '16 at 17:08
  • 2
    Show us the output of `sh -x script.sh` and `sh -x mount.sh`. So far your description is not much different from *Doctor, it hurts*. – Jens Jul 28 '16 at 17:11

1 Answers1

1

We may only guess but experience suggests it's always about PATH or permissions.

Probably, while "script.sh does some steps" it also changes current directory, so ./mount.sh simply fails to invoke. Review "script.sh" to prevent this.

Matt
  • 13,674
  • 1
  • 18
  • 27