Red Squirrel
No Lifer
Seems I can't find anything on Google, maybe I'm not searching the right thing.
What I'm trying to do is write a bash script (part of a basic setup procedure for an app I wrote) and the user enters where they want the program installed. After it copies the files, it has to compile it, but I don't want to run the compile script in place as it will probably dump the exe in whatever folder the user is in. I want to execute the script from within it's own folder.
I tried using "cd [path]" within my script but it does not seem to work. Hard coding the path in the compile script is not an option, because it's unknown until the user enters it.
How do I go about doing this, I can't see it being very complicated, just can't seem to find anything.
edit: Nevermind! Turns out the cd method does work, it just happened the file I thought I was copying was not actually being copied so it never got executed.
What I'm trying to do is write a bash script (part of a basic setup procedure for an app I wrote) and the user enters where they want the program installed. After it copies the files, it has to compile it, but I don't want to run the compile script in place as it will probably dump the exe in whatever folder the user is in. I want to execute the script from within it's own folder.
I tried using "cd [path]" within my script but it does not seem to work. Hard coding the path in the compile script is not an option, because it's unknown until the user enters it.
How do I go about doing this, I can't see it being very complicated, just can't seem to find anything.
edit: Nevermind! Turns out the cd method does work, it just happened the file I thought I was copying was not actually being copied so it never got executed.
Last edited: