control sub-shells


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting control sub-shells
# 8  
Old 07-14-2008
Quote:
Originally Posted by MarkZWEERS
I've always learned to run scripts with a '.' (so that it runs in the current shell), and to run binairies (executables) without, or with ./ if the path is not set in the .bashrc or .kshrc
I would consider always running scripts with a '.' to be a bad habit as you don't want the environment of your current shell to be modified all the time by any scripts you run.

Using ./ however is a good habit because it explicitly avoids running scripts in your PATH that you are not aware of. It is recommended over having '.' in your PATH because that could be risky if someone happened to drop a trojan called, for example, ls in your home directory, which would be run instead without you even noticing.

Quote:
Originally Posted by MarkZWEERS
ps: to run a script, one should make it executable by "chmod 777"

pps: '750' also works
chmod 777 is a bad idea, as you are granting world write access. 750 or 755 are much more sensible.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Please what are shells?

I mean like this: http://shells.red-pill.eu/ Can anyone explain how this works? I hope my post is not spam. I think its related to linux. Thank you (1 Reply)
Discussion started by: postcd
1 Replies

2. UNIX for Dummies Questions & Answers

Shells

Lets say my default shell is bash and then i load up csh and then ksh. How would i exit csh without exiting ksh? so basically i gone from bash > csh > ksh and i wish to close csh (2 Replies)
Discussion started by: Bill Thompson
2 Replies

3. Shell Programming and Scripting

Switching between shells

I don't know why, but it just isn't working how I want it to work. You might want to run it to see what I mean. Or you might be a genius (or just really good at unix) and know just by looking at it what the problem is. Have fun trying to figure this one out.:wall: (11 Replies)
Discussion started by: nowruzr
11 Replies

4. Shell Programming and Scripting

Differences between shells

What is the practical difference among the different shell like csh , ksh , bash etc.:confused::confused: Please use descriptive subjects instead of single words (2 Replies)
Discussion started by: hiten.r.chauhan
2 Replies

5. UNIX for Advanced & Expert Users

why we have different shells?

Can you pls. tell me, why we have different shells in UNIX OS ( Eg. SunOs) and also I would like to know what is the specific difference b/w SVR and BSD ? Thanks. (2 Replies)
Discussion started by: shahnazurs
2 Replies

6. Shell Programming and Scripting

different kinds of shells

Can anyone tell me about the classification and significance of variuos unix shells and why is only sh used for most shell scripting? (3 Replies)
Discussion started by: gurujoe
3 Replies

7. Shell Programming and Scripting

Different type of shells?

Hello there, i just want to know what are the different type of shells and the main difference betwee them. The problem is that if you try to search over the net you will find a lot of information and hence you will have no enough time to read all of them.....Anyone can help with this?? (1 Reply)
Discussion started by: charbel
1 Replies

8. UNIX for Advanced & Expert Users

Shells

I have came across the definitions of these shells korn bourne c etc .. but honestly till now i din't get the exact difference between these threes , the advantages ..... can anyone pinpoint me where it actually lies ..... don;t include me answers like aliasing in c is posible and not in bourne ..... (3 Replies)
Discussion started by: dino_leix
3 Replies

9. UNIX for Dummies Questions & Answers

switching shells??

Hi How can i switch shells on linux and freebsd? i tried changing the passwd file and restarted the computer but i still get the same old shell. anybody has the answer? thanks (6 Replies)
Discussion started by: xNYx
6 Replies

10. Shell Programming and Scripting

Different type of Shells

Hello every body iam new to UNIX and shell scripting and i would like to know the different type of shells. And also i would like to know the reason for Shell scripts And tell me which will be the best site for UNIX beginners. Regards Sivam. :rolleyes: (5 Replies)
Discussion started by: sivhard
5 Replies
Login or Register to Ask a Question