". ./" Whats that?

mrmagoo_83

2[H]4U
Joined
Aug 8, 2002
Messages
3,068
I am working on some scripts for work. I need to telnet from one server to another run another script on that server, once that is done return back to server 1. All via a script.

I have no problem telneting over, the issue arrises when i try to run the script on the second server. I stumbled across the ". ./" in another script someone else wrote and was wondering if anyone could tell me what it does?
 
../ means go up one directory.

For example, you're in the directory /home/name/files

If you're in files, and you do

Code:
cd ../

you'll be in /home/name
 
On a related note, "." is the directory you're in. Handy if you need to specify a directory and you want the current one.
~ is your home directory, so ~/.cshrc is your csh/tcsh - settings file.
 
"../" is up one directory, but ". ./[something]", assuming
that space isn't a typo, means "execute [something], which you
will find in the current directory, and use the current shell,
don't spawn a subshell like you normally would". Generally
that's used if the script needs to set environment variables
in your current shell.
Or was that space a typo?
 
shieldforyoureyes said:
"../" is up one directory, but ". ./[something]", assuming
that space isn't a typo, means "execute [something], which you
will find in the current directory, and use the current shell,
don't spawn a subshell like you normally would". Generally
that's used if the script needs to set environment variables
in your current shell.
Or was that space a typo?

No you hit it on the money. I knew "cd ../" takes me up a level. I was refering to the ".(space)./" wasn't sure what that did. So I guess it will not help me, I will have to find out another way to force start a script on another server.
 
is ssh an option?
i dont know enough about telnet to help with your problem, but i dont see why this would not work with ssh

other than the fact putting login credentials in an automatically executing script is bad security practice
 
If the two machines are set up to trust each other, on a private
LAN, you can use rsh:
$ rsh remote-machine command blah blah blah
You can even pipe to & from rsh invocations.
 
Back
Top