This is a Unix Shell Script Qusn

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sumeet
Premium Member
Premium Member
Posts: 54
Joined: Tue Aug 30, 2005 11:44 pm

This is a Unix Shell Script Qusn

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post 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
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

And this is only in SunOS.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? What is only in SunOS? I don't see anything here that isn't standard UNIX.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's a specific ls option, perhaps that particular OS has it 'on' by default or you are using an alias there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply