problem in a shell based project


 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions problem in a shell based project
# 8  
Old 11-17-2010
For instance, if it is a ksh script and a path to ksh is /usr/bin/ksh, since ksh will gladly run a script as
Code:
ksh script_name

unlike sed where you say
Code:
sed -f script_name

so you need no argument, the first line should be:
Code:
#!/usr/bin/ksh

Sometimes this is called the magic. For our memory, we call this "pound-bang"! It is documented in man 2 exec:
Man Page for exec (OpenSolaris Section 2) - The UNIX and Linux Forums
It also guides the file command to identify it as a ksh script. As the man page warns, you might end up under some shell (sh?) as stdin without it. In UNIX, interpreted files with right permissions
Code:
chmod u+x script_name

are just as executable as binaries to the common loader, exec().

The only thing where scripts are second class is if you would set setuid or setgrpid bits with chmod and have scripts that change user or group; it is too insecure, so when loading setuid/setgrpid, the dynamic library path is unset by exec as it changes user/group, and withou it the ksh cannot run. A C program compiled with -R can have hard coded dynamic library paths and so be setuid/setgrpid. Many commands you use to see OS things or affect other processes are setuid to a super-user:
Code:
$ ls -ld /bin/*|sort
-r-sr-x---   1 root       suallow      24576 Aug  6  1998 /bin/su
-r-sr-xr-x   1 lp         bin          16384 Oct 27  1997 /bin/slp
-r-sr-xr-x   1 root       bin          20480 Jan 21  2004 /bin/newgrp
-r-sr-xr-x   1 root       bin          24576 Jan 10  2001 /bin/bdf
-r-sr-xr-x   1 root       bin          24576 Nov  7  2001 /bin/rexec
-r-sr-xr-x   1 root       bin          28672 Mar  5  2004 /bin/nfsstat
-r-sr-xr-x   1 root       bin          32768 Jun 18  2002 /bin/crontab
-r-sr-xr-x   1 root       bin          32768 Nov  7  2001 /bin/remsh
-r-sr-xr-x   1 root       bin          45056 Nov  7  2001 /bin/rlogin
-r-sr-xr-x   1 root       bin          49152 Nov  6  1997 /bin/chkey
-r-sr-xr-x   1 root       bin          49152 Nov  7  2001 /bin/rcp
-r-sr-xr-x   1 root       bin          53248 Aug 14  2002 /bin/login
-r-sr-xr-x   1 root       bin          53248 Jun 18  2002 /bin/at
-r-sr-xr-x   1 root       bin          65536 Oct 20  1999 /bin/mediainit
-r-sr-xr-x   1 root       bin          73728 Feb 25  2003 /bin/df
-r-sr-xr-x   1 root       bin          73728 Nov  7  2001 /bin/rdist
-r-sr-xr-x   5 root       bin          49152 May 23  2001 /bin/chfn
-r-sr-xr-x   5 root       bin          49152 May 23  2001 /bin/chsh
-r-sr-xr-x   5 root       bin          49152 May 23  2001 /bin/nispasswd
-r-sr-xr-x   5 root       bin          49152 May 23  2001 /bin/passwd
-r-sr-xr-x   5 root       bin          49152 May 23  2001 /bin/yppasswd


Last edited by DGPickett; 11-17-2010 at 09:01 PM..
This User Gave Thanks to DGPickett For This Post:
# 9  
Old 11-19-2010
thanx for all your support

i corrected that problem.....
this problem was due to the placing of balance updation code inside the amtvalidation function ....

i kept this code out side the function and problem was corrected

the code that i have pasted in this thread was running fine because it has the updation code separate from validation function .....
but in my office server it was inside the validation function


once again
thanx a lot
# 10  
Old 11-19-2010
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Open Source

Project planing - with Linux based solutions

Hello, Please suggest or share any of your experience for the following requests: Request: 1. Creation of the local network. The company will be in the field of IT. 10-15 persons. 10 will be physically in the office. The local network should be secured and all the files and... (0 Replies)
Discussion started by: AQwert
0 Replies

2. Solaris

Solaris based project?

Hi friends, I am a Computer Science student, and about to do my final year project. I am a big lover of Solaris and SPARC RISC computers, and I want to work on those computers in future. I want to become a System Administrator/Security Administrator etc on the Solaris stuff. Could you please tell... (1 Reply)
Discussion started by: gabam
1 Replies

3. Homework & Coursework Questions

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

4. UNIX for Advanced & Expert Users

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

5. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

6. Hardware

Need ideas for graduation project based on unix or linux

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

7. Solaris

building solaris-based enterprise router-firewall project

hi guys, its been a while since my last visit here, could not keep up the pace on this ever changing industry :) i'd just doing my home research under vmware to make a solaris-based router-firewall using zones - doing a lot of reading about zones & review solaris zone functionality. and... (4 Replies)
Discussion started by: stdout
4 Replies

8. Programming

Problem with kerberos cpp project

Hi All, I am having problem with kerberos kadmin library in c++. I am using red hat linux Enterprise Linux Server release 5 (Tikanga), and gcc c++ - 4.1.1-52.el4.i386. When I make a c project (main.c) and use function from kadmin library such as kadm5_init_krb5_context(&context); ... (2 Replies)
Discussion started by: amitp
2 Replies

9. Shell Programming and Scripting

project idia in shell

could any one provide me any new real time project idea in shell scripting i am learning shell script and wants to do some real time development . (1 Reply)
Discussion started by: useless79
1 Replies
Login or Register to Ask a Question