It seems fine. However, I wouldn’t put it in the /home directory. Why not just put the script in the /usr/bin directory so that you can call it directly without any path (ie CF.sh)
The actual challenge is that we have to figure out a way to execute a set of commands in a New terminal after executing the “pterm &” command
for Example: #Script Start
pertm &
ls -l #Script End
If the above script is executed we would get a new terminal opened with the “ls” got executed in the Old terminal.
Instead is there a way to execute this command in the New terminal that was recently spawned.
So put all the commands you want to execute in your pterm into another script called myCommands. Then call that script from your script:
#Script myCommands
ls -l #Script End
#Script Start
pertm ./myCommands & #Script End
There are probably other ways to do it but this seems to be a simple way to do what you want. Assuming of course you don’t need to pass any results of commands executed back to your original script.