Visit Our UNIX and Linux User Community


execute


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting execute
# 1  
Old 07-22-2009
execute

can someone tell me what is the difference between . and ./ in a script
# 2  
Old 07-22-2009
. is used to execute something without forking - i.e in the current environment (I'm sure someone else could give you a better explanation if that's not technically accurate).

./ is used to mean something in the current directory. You would use this to run something in the current directory, if that directory (either fully qualified, or .) is not in your path
# 3  
Old 07-27-2009
Could it be executing the wrong shell

I was wondering when you log on to a unix box how does unix know what the default shell type is, C shell, borne shell, korn shell. My understanding is it executes different login scripts depending what the default is . Could this have any impace on why I need to use ./ instead of .

I have included :. in /etc/profile but it has not corrected the problem. Any other suggestion most welcomed.

Thank to all who have replied.
# 4  
Old 07-27-2009
/etc/passwd determines the login shell.
Did you logout/login or source your profile changes when testing?
Code:
echo $PATH

if it looks something like this, especially the first two characters
Code:
echo $PATH
.:/usr/bin:/usr/sbin

What you want (no leading ./) definitely should work for you. And, of course, the scripts in question - the ones in your directory - have execute permissions set.

Previous Thread | Next Thread
Test Your Knowledge in Computers #413
Difficulty: Medium
The AT&T 3B1, also known as the PC7300 or UNIX PC, was a desktop workstation computer based on the Motorola MC68010 microprocessor, running an operating system from Convergent Technology (based on Unix System V Release 2).
True or False?

10 More Discussions You Might Find Interesting

1. AIX

Need ./ to execute scripts

Hi, I am really sorry for this question but still i am confused. I have shell script called sample.sh I can execute only with the combination of ./sample.sh Is ./ really necessary ? Is it something related with $HOME or $PATH variable. Why and How can i resolve this case ? ... (2 Replies)
Discussion started by: Nandy
2 Replies

2. Shell Programming and Scripting

how to execute

Hi, I have a query for executing the script. I have a script in korn shell. Now I want to execute that script in the born shell. How can I execute. (3 Replies)
Discussion started by: nagraju.allam
3 Replies

3. Shell Programming and Scripting

execute c

i wish to have a shell script which receives the file name and path (from the user) to a text file that contains a c program and compiles the program code using gcc and displays the execution of the compiled file (which is saved as filename.c) in the terminal / konsole Can any one help me by... (1 Reply)
Discussion started by: anurag.mishra1
1 Replies

4. Shell Programming and Scripting

execute script

Hi everybody: I would like to know how I can execute a script which to execute we have to follow different steps. I have did that this script needs some users features. These features are introduced from screem, but ussually these are equal. for this reason I would to to know if it is possible... (1 Reply)
Discussion started by: tonet
1 Replies

5. Shell Programming and Scripting

Need to execute the same statement

I have written a script for converting an IP address into its corresponding AS number in PHP. But based on the timing analysis, I've observed that it takes a long time to process large number of entries. So I need to do something directly in unix. What method would one suggest for this purpose? ... (8 Replies)
Discussion started by: Legend986
8 Replies

6. Shell Programming and Scripting

execute

Hi All I have a file containing the following information SOURCESERVER DESTINATIONSERVER DESTINATIONENVIRONMENT CONDITION I was trying to read and then execute the conditions,like if SOURCESERVER is XXXX0001 and the DESTINATIONSERVER is XXXX0002 and the DESTINATIONENV is YYY the... (3 Replies)
Discussion started by: bkan77
3 Replies

7. Shell Programming and Scripting

script execute or no execute

o hola.. Tengo un script que se ejecuta bajo una tarea del CronJOb del unix, tengo la version 11 de unix, mi script tiene un ciclo que lee unos archivos .txt luego cada uno de esos archivos debe pasar por un procedimiento almacenado el cual lo tengo almacenado en mi base de datos oracle 10g,... (4 Replies)
Discussion started by: Kespinoza97
4 Replies

8. Shell Programming and Scripting

Only Execute Permission for Others...

This might be very silly question but i dont know y is it so... i Have script I have Given the permissions in the following manner... -rwxrwx--x 1 root system 3 Jun 08 15:46 temp I want no one to see what is present in that but should be able to execute it.. but when... (3 Replies)
Discussion started by: pbsrinivas
3 Replies

9. Shell Programming and Scripting

How do i execute in IF ELSE Statement

ls -ld /path/to/dir1 path/to/dir2 | awk '{print $8}' how to execute above script in IF ELSE Statement. Pls iam new to Unix (1 Reply)
Discussion started by: laknar
1 Replies

10. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies

Featured Tech Videos