0

Good day all,

I'm trying to open a new terminal using a current terminal and execute a program in a specific directory. I've found a lot of documentation on the web so far, such as these:

How can I make a script that opens terminal windows and executes commands in them?

How do I make an entire directory executable?

So, those explain different methods of opening a new window, either by using the gnome-terminal command or the x-terminal-emulator command and then how to pass commands to it. I tried to execute a command doing this, and it said:

Failed to execute child process "/home/pciedev3ubuntu/Documents"    (Permission denied)

As someone mentioned in one of them those, the directory path must be executable to do this. So, I tried using the chmod +x command on the directories to allow this to work. The chmod command works on user and Documents, but not home. So, I did it on the two and tried it again, but still get the same message.

I also tried the example using a profile that was created but still run into the same problem.

I'm guessing this is just a basic thing in Linux that you should know, but I am clueless as to how to change the mod for this to work.

I also tried running it with sudo, but it still comes back as permission denied.

Thanks in advance.

  • What are you trying to do, exactly? Can you illustrate with an example? You probably shouldn't be trying to execute a directory (that's not what the x permission bit means in that context): instead you should change to (cd) the directory and then execute a specific program file. – steeldriver Mar 25 '16 at 15:21
  • I'm trying to open a new terminal with one of the two commands I mentioned, and then immediately execute a python program or bash file within that new terminal. Ultimately, this will be put inside a python program with a GUI and when a user presses a button, it will toggle another terminal to open and launch a corresponding bash/python script. From what I saw in the instructions and from testing, it just says cd is not a directory when I try to pass it through as a command for some reason – Trever Wagenhals Mar 25 '16 at 15:51

1 Answers1

0
# first change to the directory where your executable lies (make sure you have permissions on tha directory)

cd /BESTFULLPATH 

# then run your new terminal

gnome-terminal --profile=YOURPROFILENAMEHERE --working-directory=/PATHAGAIN -e ./WHATYOUWANTTORUN
Videonauth
  • 33,355
  • 17
  • 105
  • 120