Please help me make a Linux script

Shaka

Senior member
Oct 13, 1999
608
0
0
Hi,

To access a service in Unix, I have to type:

rlogin 128.97.xxx.xxx ?l app

(the -l is lower case L and not the number "1")

Is there someway I can make a batch file of sorts and just execute it so I don't have to remember that ip? Thanks.
 

BOFH

Senior member
Dec 31, 1999
456
0
0
1) you should never publish anywere the ip of a box running rlogin that is accessable from the internet.

2) yes you can do it, but you don't need a 'batch' command. you should alias that command line to something simpler such as rlwork. you don't mention your shell. If you're using bash alias is a built in and you can simply

alias rlwork='rlogin ipaddress -l app'
 

fogleroller

Senior member
Aug 23, 2000
752
0
71
What is Gilligan?

you should edit your first post and change that IP address. Just to be safe.
 

Shaka

Senior member
Oct 13, 1999
608
0
0
Whoops, sorry about posting that IP. I was being too naive.

Well, I tried typing in the alias command, and it didn't give me an error, but it said command not found afterwords.

How do I find out what shell I am using. Sorry for being such a Unix newbie.
 

doug

Senior member
Oct 18, 1999
259
0
0
you could do this:
- create a file called rlog.sh containing:

#!/bin/sh
rlogin 128.97.xxx.xxx ?l app

- Then make the file executable using
chmod u+x rlog.sh
 

Supergax

Senior member
Aug 6, 2000
639
0
0
you can find your shell by typing echo $SHELL, and it should return one of the following:

/bin/bash --> Bash Shell (also called Bourne Again Shell)
/bin/sh --> Bourne Shell
/bin/ksh --> Korn Shell
/bin/csh --> C-shell
/bin/tcsh --> Enhanced C-shell

Sometimes it might show as something like /usr/local/bin/bash but that would be the same shell that /bin/bash is (even though it's not in the same directory).

There are other shells such as the POSIX shell and whatnot but the ones I've listed are the most common types of shells out there.

If you are new to Linux/Unix and want to find out more I strongly recommend O'Reilly books, which you can find at most bookstores like Borders or Barnes & Nobles, or can find at their site www.oreilly.com.
 

Shaka

Senior member
Oct 13, 1999
608
0
0
Hmm... it says permission denied. That sucks.

Ahh, it's C-shell. I guess that will be good to know in the future. I will check out those O'Reilly books. Thanks everyone!
 

MereMortal

Golden Member
Oct 16, 2000
1,919
2
81
If you're running a C-shell, you can just put something like the following in your .cshrc file (in your home directory):

alias rlw 'rlogin 128.97.xxx.xxx -l app'
 

Shaka

Senior member
Oct 13, 1999
608
0
0
Home directory? The thing is, I telnet into a unix system (not that rlogin one). Then I use rlogin 128.XXX.XXX.XXX to get to the other system. The second system is the one I want to write an alias for. When I first telnet into the 1st system, I end up in a personal directory. I can only manipulate/create/delete files in my personal directory. I don't think I have priveleges to modify anything anywhere else. This is probably why I get permission denied. But I really have no clue... I think I'll ask some of the people who run the system. Thanks for all your help guys!
 

rahvin

Elite Member
Oct 10, 1999
8,475
1
0
DO NOT run rlogin, that stupid program has SO many vulnerabilities it isn't even funny. You have a box with rlogin open to the net and you will have it rooted within a month, especially considering you posted the IP here.
 

Supergax

Senior member
Aug 6, 2000
639
0
0
Actually, I was kinda wondering that myself, why aren't you telneting to the other box?
 

Supergax

Senior member
Aug 6, 2000
639
0
0
ssh2 should replace both rlogin and telnet (ssh has a bunch of security problems). Of course, not everyone can ssh for some reason or another, and in those times telnet is much better than rlogin.
 

BOFH

Senior member
Dec 31, 1999
456
0
0
Supergax

ssh2 has problems also. you should keep up to date no matter what version you're using. I personally prefer OpenSSH since the license is MUCH more to my liking.