0

I am having an issue with calling a tclsh script from within a sh script on Ubuntu.

I can call the tclsh script form the terminal successfully, yet as soon as I try and automate its calling from within the sh script it fails. I believe it to be a permissions error but have no idea how to correct it.

My process is as follows, note that I am running everything as root and have tried giving every script executable permissions also I am trying to reduce the complexity of the problem:

./shellscript.sh

shellscript.sh:

#!/bin.bash    
#do stuff
delete.tcl

delete.tcl:

#!/opt/ActiveTcl-8.6/bin/tclsh

file delete test.txt

test.txt is silently not deleted.

In a more complicated scenario I am unable to connect to a port because of what I presume to be similar permissions issues.

Any idea how I could approach this differently, or fix my permissions issue?

Tom
  • 23
  • 4
  • 1. does delete.tcl have execute permissions? 2. is it located in a diectory in your $PATH? – glenn jackman Jul 19 '16 at 19:29
  • 1
    Are you sure your file delete case isn't a path or working directory problem? – Spiff Jul 19 '16 at 19:32
  • good point: @tom where is test.txt? is it in the same dir as ./shellscript.sh? – glenn jackman Jul 19 '16 at 21:02
  • I know the directory not to be an issue, and while I didn't note it, there is a pushd to the correct directory, also this is a simplification of a different problem, which due to being a connection problem does not have directory issues. 1. delete.tcl has execute permissions. 2. delete.tcl is not in $PATH (though why should it be) – Tom Jul 19 '16 at 22:01

0 Answers0