For a file to be executed it must have execute permission set
. In fact, trying to run from a terminal file (whether it be a executable, a script or otherwise) that did not receive permission to run the error message:
bash:. / Filename: Permission denied
( where filename is the name of the file that you tried to run).
To set the execute permissions from the terminal should use the chmod command
. The command syntax is chmod [options] filename permissions
For what interests you about to make an executable file, the command is chmod + x
filename The file to make executable can be specified by indicating that the absolute or relative, as you prefer. For all other uses and options chmod
you can consult the manual using the usual command man chmod
.
course, you can make an executable file using the graphical interface. If you use Nautilus, the default file manager for GNOME, you must click the right button on a file icon, choose Properties , tab
Permits must be then put the check in Allow executing file as program .
You can also use the following short Nautilus script that I wrote to make even more executable files at once with just one click: # / bin / bash
for arg ; do chmod u + x -
"$ arg" done
(like gedit ), copy the script editor and save it in cartella ~/.gnome2/nautilus-scripts (ricordo che la tilde
~
è un'abbreviazione della cartella home dell'utente corrente) chiamandolo, per esempio,. Rendete quindi eseguibile lo script in uno dei modi descritti in precedenza. In questo modo, selezionando e facendo clic con il tasto destro sui file a cui vorrete assegnare il permesso di esecuzione, vi basterà fare clic su
Rendi eseguibile
Script → Rendi eseguibile
(o il nome che avete dato allo script).
0 comments:
Post a Comment