Sponsored Content
Top Forums Shell Programming and Scripting Unable to make script executable Post 302364820 by thegeek on Saturday 24th of October 2009 04:48:52 AM
Old 10-24-2009
1. when you execute as ./SCRIPT-NAME there is no need for you worry about the PATH.

2. Only you need to check, permission & she-bang.
It seems you have got permission already right.
What about she-bang ?! Have you given it correctly.

Also, it is good to post the error also, when you say some issue instead of just explaining about it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I make a cgi script World-executable

I'm trying to set up a form mail script on a website that when Submitted, a cgi script is executed and a perl translator (located in a secured and inaccessible folder) translates the script. After speaking to my hosting provider, I was told to "Telnet into the system and make the script... (2 Replies)
Discussion started by: tylerl
2 Replies

2. Solaris

How to make a script executable by all users?

I have a script in my home direcroty which upon execution gives the essential system information like memory,cpu etc and is currently owned by root:root. Now I want to see that every non root user will run this file and grab the reqired system info. I know this is some thing associated with chown... (2 Replies)
Discussion started by: chrs0302
2 Replies

3. Shell Programming and Scripting

run and make an executable file

as i said before i'm a beginner in shell programming and i have two questions: how to run an executable file in shell scripts like for example let's say the file called "prog.exe", what's the shell command to run this file? also how can i make the shell file an executable file (if it is... (5 Replies)
Discussion started by: _-_shadow_-_
5 Replies

4. Shell Programming and Scripting

How to make a script (Bash, KornShell, etc.) executable by mouse clicking?

Hello everybody, Is there any way to make a script (Bash, KornShell, etc.) executable by mouse clicking? For example you have a file myscript.sh, you run: $ chmod u+x myscript.sh Therefore it becomes executable and all you need is to run from the terminal: $./myscript.sh... (2 Replies)
Discussion started by: dariyoosh
2 Replies

5. Shell Programming and Scripting

Unable to call executable from script

Now I am using the HP-UX11.11 version. The scripts are runninh in KSH shell. While I wan to call one executable of any Pro*C file, I have got the following error, however the executable is running fine directly. testpri Started at 10.05.200923:40 /usr/lib/dld.sl: Bad magic number for... (0 Replies)
Discussion started by: priyankak
0 Replies

6. Shell Programming and Scripting

Make multiple awk files into an executable

Hello everyone, The following are my input files. The following are my sequence of steps. Can someone please let me know about how to make these bunch of steps into a single script so that I start the script with 1.txt and 2.txt, after execution gives me the final... (11 Replies)
Discussion started by: jacobs.smith
11 Replies

7. UNIX for Dummies Questions & Answers

Command - filename as arguments - make executable to all users.

Edit: Sorry. Mistakenly posted - please delete (3 Replies)
Discussion started by: Reddax
3 Replies

8. UNIX for Beginners Questions & Answers

How to make a dynamically linked executable file?

So I have a file called queens.cc and I need to do the following: Compile and make a .o file while specifying that the compiler is to search /student/214/include for system include files. Use g++, link and load .o file to make a dynamically linked executable file called queens and to also... (1 Reply)
Discussion started by: steezuschrist96
1 Replies

9. Shell Programming and Scripting

Bash script make itself executable

Is there a way to make this make itself executable? Thanks. :-) cat > somescript.sh << \EOF #!/bin/bash block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Block count:/ {print $NF}') reserved_block_count=$(sudo tune2fs -l /dev/sda1 | awk '/^Reserved block count:/ {print $NF}') perl -e... (4 Replies)
Discussion started by: drew77
4 Replies

10. UNIX for Beginners Questions & Answers

How to make a .exe file executable in Linux?

Dear all, I download a .exe file in my current folder called: ukbmd5.exe. I was told to run the command below: ukbmd5 ukb25278.enc to verify the integrity of the files that you have downloaded and the program ukbmd5 has been made available to assist with decrpying ukb25278.enc. while when I run... (1 Reply)
Discussion started by: forevertl
1 Replies
chmod(1)						      General Commands Manual							  chmod(1)

Name
       chmod - change file mode

Syntax
       chmod [ -fR ] mode file...

Description
       Permissions on files are set according to mode and file parameters.

       For file, you can specify either a full or partial path.  You can specify multiple files, separated by spaces.

       For mode, you specify one of two variants: absolute mode or symbolic mode.

   Absolute Mode
       For mode in absolute form, you specify an octal number constructed from the sum of one or more of the following values:

	      4000	set user ID on execution (applies to executable files only)
	      2000	set group ID on execution (applies to executable files only)
	      1000	set sticky bit (see for more information)
	      0400	read by owner
	      0200	write by owner
	      0100	execute, or search if file is a directory, by owner
	      0040	read by group
	      0020	write by group
	      0010	execute, or search if file is a directory, by group
	      0004	read by others
	      0002	write by others
	      0001	execute, or search if file is a directory, by others

       For  example, the absolute mode value that provides read, write, and execute permission to owner, read and execute permission to group, and
       read and execute permission to others is 755 (400+200+100+40+10+4+1).  The absolute mode value that provides read, write, and execute  per-
       mission to owner and no permission to group or others is 700 (400+200+100).

   Symbolic Mode
       To specify mode in symbolic form, use the following format:

	      [who] op permission [op permission] ...  Spaces are included in the preceding format so that you can read the arguments; however, as
	      will be shown in examples that follow, you do not enter spaces between mode arguments.

       Specify who using the letters u (for owner), g (for group) and o (for others) either alone or in combination.  You  can	also  specify  the
       letter  a (for all), which is is equivalent to the letter combination ugo.  If you omit the who parameter, a is assumed.  For more informa-
       tion, see

       For the op parameter, specify the plus sign (+) to add permission to the file's mode, the minus sign (-)  to  remove  permission  from  the
       file's  mode,  or the equal sign (=) to assign permission absolutely (denying or revoking any permission not explicitly specified following
       the equal sign).  The first command in the following example provides group with execute permission for in addition to  any  other  permis-
       sions group currently has for The second command limits the permission that group has for to execute alone:
       chmod g+x filea
       chmod g=x fileb

       For  the  permission  parameter,  specify any combination of the letters r (read), w (write), x (execute), s (set owner or group id), and t
       (save text - sticky).  Alternatively, you can specify the letter u, g, or o to set permission for the who parameter to be the same  as  the
       permission  currently granted to the user category indicated by the letter.  In the following example, the group (g) is given the same per-
       missions on as currently granted to owner (u):
       chmod g=u filea

       You can revoke all permissions by specifying the who argument followed by =, and omitting the permission argument.  For example,  the  fol-
       lowing command removes all permissions from others for
       chmod o= fileb

       When  specifying  more than one symbolic mode for file, separate the modes with commas. The mode changes are applied in the sequence speci-
       fied.  In the following example, write permission is added to the permissions already granted to the owner of and group is then granted the
       same permissions on as granted the owner:
       chmod u+w,g=u filea

Options
       -f   Inhibits display of errors that are returned if fails to change the mode on a file.

       -R   Causes  to	recursively descend any directories subordinate to file and to set the specified mode for each file encountered.  However,
	    when symbolic links are encountered, does not change the mode of the link file and does not traverse  the  path  associated  with  the
	    link.  Note that the option is useful only when file identifies a directory that is not empty.

Restrictions
       The permission letter s is used only with who letter u or g.

       Only the owner of a file  or someone logged on as superuser may change the mode of that file.

Examples
       Using  absolute	mode,  provide	read,  write, and search permission to the owner, and read and search permission to others for a directory
       named
       chmod 755 ~harris/public

       Using absolute mode, set the UID for execution to be the UID of of the file owner rather than the UID of the user running  the  program	as
       follows:
       chmod 4000 progrmb

       Using symbolic mode, perform the same operation as described for the preceding example:
       chmod u=s progrmb

       Using symbolic mode, deny write permission to others for the file
       chmod o-w ourspec

       Using symbolic mode, give execute permission on file to all user categories:
       chmod +x myprog

       Using symbolic mode, give write permission to all group members, deny write permission to others, and give search permission to owner on
       chmod g+w,o-r,u+x docdir

       Using  symbolic	mode, give read and execute permissions to others for a directory named and then recursively descend the paths subordinate
       to adding the  same permissions for others on all files and directories included in the subordinate paths:
       chmod -R o+rx programs
       In the preceding example, if were the name of a file rather than a directory, would change the mode only of the file.

See Also
       ls(1), chmod(2), stat(2), umask(2), chown(8)

																	  chmod(1)
All times are GMT -4. The time now is 04:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy