Shell script / Launcher

Asked by peter

Hi

I've the shell script xyz.sh. It contains few commands. I've created a launcher:
- Type: Application in Terminal
- Command: sh /root/Own_Data/Sys_Admin/Trash/xyz.sh

The Terminal opened and closed immediately. What can I do? Thanks in advance.
Peter

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
peter
Solved:
Last query:
Last reply:
Revision history for this message
juancarlospaco (juancarlospaco) said :
#1

are Working Perfectly.
because /root/ is "root only" access.
put the Script on your home directory, not in /root/

Revision history for this message
peter (peter-neuweiler) said :
#2

I'm logged in as root. And the Owner of the script is root.
Peter

Revision history for this message
peter (peter-neuweiler) said :
#3

I've got a new situation: I've an open terminal and in the Terminal is written:
sh: /root/Own_Data/Sys_Admin/Trash/xyz.sh: Permission denied

Why is the permission denied?

I'm logged in as root. The file xyz.sh belongs to the owner root. Can you help? Thanks in advance.
Peter

Revision history for this message
Vojtěch Trefný (vojtech.trefny) said :
#4

Please send us output of this command:

ls -la /root/Own_Data/Sys_Admin/Trash/xyz.sh

Revision history for this message
peter (peter-neuweiler) said :
#5

root@linux-desktop:~# ls -la /root/Own_Data/Sys_Admin/Trash/xyz.sh
-rw-rw-rw- 1 root root 59 2009-02-12 16:11 /root/Own_Data/Sys_Admin/Trash/xyz.sh
root@linux-desktop:~#

Thanks.Peter

Revision history for this message
peter (peter-neuweiler) said :
#6

The problem has solved. Thanks!
Peter

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

For the other users that will read this question...

The file xyz.sh was not executable.

We can execute a no executable file by typing:

sh /root/Own_Data/Sys_Admin/Trash/xyz.sh

or make the file xyz.sh executable, changing the permission for the owner.

chmod +x /root/Own_Data/Sys_Admin/Trash/xyz.sh

So the file now have execute permission for the owner, the "root" user:

ls -la /root/Own_Data/Sys_Admin/Trash/xyz.sh
-rwxrw-rw- 1 root root 59 2009-02-12 16:11 /root/Own_Data/Sys_Admin/Trash/xyz.sh

then to run run the file we must type:

/root/Own_Data/Sys_Admin/Trash/xyz.sh

or

cd /root/Own_Data/Sys_Admin/Trash/

./xyz.sh

Hope this helps

Revision history for this message
peter (peter-neuweiler) said :
#8

Hi marcobra

Thanks for the hints. I did the following:
- sh /root/Own_Data/Sys_Admin/Trash/xyz.sh

It works perfect.
Peter