change directory and execute script

I'm trying to write a small program that gets 4 input values from the user and based on the first 3 values will change to a specific directory on a unix system. Using the fourth value it will execute a perl script in the directory. The fourth value is a variable in the script command line. What are some of the ways to get the program to do a CD and execute the script? Thanks for any suggestions/help. Steve

[417 byte] By [rangerfan94a] at [2007-11-26 13:19:06]
# 1

> I'm trying to write a small program that gets 4 input

> values from the user

you can use prompt for console app or build a gui

> and based on the first 3 values

> will change to a specific directory on a unix system.

skip that step

> Using the fourth value it will execute a perl script

> in the directory.

Runtime.exec() is what you need or something to that effect (Google)

> The fourth value is a variable in

> the script command line. What are some of the ways

> to get the program to do a CD and execute the

> script? Thanks for any suggestions/help. Steve

just execute the script using the full path, not sure CD will do anything for you

SoulTech2012a at 2007-7-7 17:45:19 > top of Java-index,Desktop,Developing for the Desktop...
# 2
Thanks for the help. I had done some searching and found the Runtime exec command. The CD command was to change to the directory where the script executes from but you're right when you say I can just execute the script by listing the path to where it's located. Thanks
rangerfan94a at 2007-7-7 17:45:19 > top of Java-index,Desktop,Developing for the Desktop...