Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing shell script in tcl and passing parameters 1

Status
Not open for further replies.

birdy1980

Programmer
Nov 1, 2011
9
0
0
GB
Hi all

My requirement is to call a shell script within TCL which runs some sql grant scripts on a particular schema/database based on some parameters passed into the shell script

Is the command as simple as

set param1 username
set param2 password
set param3 sid

exec /tmp/bin/test_shell.sh param1 param2 param3

or is there a better approach

Thanks all
 
Other option, especially if you need to process the output from called shell script in your tcl-caller script, would be to use something like this:
Code:
set my_command "define your command here"
set f [open $my_command "r"]
...
#process command output
...
close $f
See for example call_py.tcl in this thread:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top