Page 1 of 1

This is a Unix Shell Script Qusn

Posted: Thu Aug 10, 2006 6:38 am
by sumeet
I know its not the right place to post it but I think someone should be able to give me answer to this Qusn:

how to make a shell script abc.sh -> abc.sh*

what is the difference between the above two forms and is abc.sh* an executable form.

How do we create abc.sh* from abc.sh


Thanks
Sumeet

Posted: Thu Aug 10, 2006 6:52 am
by ray.wurlod
The second form is a "regular expression" and can not be used in the command position of a command.

A Google search on UNIX "regular expression" returns over 1 million hits. One of the best is this one.

Posted: Thu Aug 10, 2006 7:13 am
by chulett
:wink: Nah... it's not a regular expression. It's just the notation that the script is executable when 'listing' it. You need chmod to enable the appropriate 'x' bits. Check your man pages or talk to your admin.

Posted: Thu Aug 10, 2006 8:25 am
by kaps
chmod rwx rwx rwx abc.sh where r means read(4), w means write(4) and x(1) means execute permissions.


If you enable the excute bit(x) then it will become abc.sh*

For example 744 should change ur script to executable

Posted: Thu Aug 10, 2006 8:29 am
by meena
Hi Kaps...
You mistyped something...write(w) =2 ..
kaps wrote:chmod rwx rwx rwx abc.sh where r means read(4), w means write(4) and x(1) means execute permissions.


If you enable the excute bit(x) then it will become abc.sh*

For example 744 should change ur script to executable

Posted: Thu Aug 10, 2006 8:36 am
by ray.wurlod
Ah, no-one mentioned ls arguments.

For each of the three (user, group, other) pieces, the mode (permissions) map to an octal numeric value. 4 = read, 2 = write and 1 = execute.
Therefore, 755 would show up as rwxr-xr-x (a fairly common combination).

The chmod command has a letter-based syntax as well as the numeric syntax. For example, you can grant (additional) execute permission to the group using chmod g+x filename as the command. Research the man page for chmod to get more information.

Posted: Fri Aug 11, 2006 6:10 am
by kumar_s
And this is only in SunOS.

Posted: Fri Aug 11, 2006 6:50 am
by chulett
:? What is only in SunOS? I don't see anything here that isn't standard UNIX.

Posted: Fri Aug 11, 2006 6:57 am
by kumar_s
Iam sorry, may be Iam wrong. I could see that * thing only in SunOS I have here. I dont see that in AIX or HU-UX. Perhaps there might be any other Os level setting available. :roll:

Posted: Fri Aug 11, 2006 7:17 am
by chulett
It's a specific ls option, perhaps that particular OS has it 'on' by default or you are using an alias there.