i have a requirement to auto execute a script as soon as the root user logs in.
- My script CF.sh is placed under /home of my QNX pc
- The CF.sh will just clear the screen and asks for the user input
(a) to mount and read the CF
(b) to exit the menu
- Following is the script i have written in .profile to auto execute my CF.sh script.
Let me know am i missing something… or is there any other way to do it
Thanks in Advance
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)
Is there a problem with the script?
Thanks fro the reply
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
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.
I use this:
pterm ./myCommands &
So put all the commands you want to execute in your pterm into another script called myCommands. Then call that script from your script:
pertm ./myCommands &
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.