-
Senior Member
registered user
help with writing script
I need to wite a very small simple script and save it to desktop to run when i need to. It is an TELNET session that runs in the Konsole. At the prompt: bob@Gateway:~$ I type in "telnet", without quotes, then "open" and then "n7us.net" So it looks like this:
bob@Gateway:~$ telnet <enter>
telnet> open n7us.net <enter>
Then it connects to the ham radio site where I can sign in. I need to know how to make a script that would do this instead of me having to type it in each time. I need the commands to:
1. bring up the Konsole
2. have it put in the command "telnet"
3. have it put in the command open n7us.net
4. have it enter/carraige return
then i can take control from there.......any ideas???? bob
-
Senior Member
registered user
Re: help with writing script
![Quote](images/misc/quote_icon.png)
Originally Posted by
bob58
I need to wite a very small simple script and save it to desktop to run when i need to. It is an TELNET session that runs in the Konsole. At the prompt: bob@Gateway:~$ I type in "telnet", without quotes, then "open" and then "n7us.net" So it looks like this:
bob@Gateway:~$ telnet <enter>
telnet> open n7us.net <enter>
Then it connects to the ham radio site where I can sign in. I need to know how to make a script that would do this instead of me having to type it in each time. I need the commands to:
1. bring up the Konsole
2. have it put in the command "telnet"
3. have it put in the command open n7us.net
4. have it enter/carraige return
then i can take control from there.......any ideas???? bob
Try makeing a script called telconnect.sh (You can use a standard txt file)
Open it and put in
Then open up a consol type
su
chmod a+x /directory/telconnect.sh
then just type /directory/telconnect.sh (or ./telconnect.sh if your in the directory.)
*edited, fixed it
-
Couldn't you just create an icon in your KDE panel? Make sure that it's set to run in terminal (or however KDE calls it). Then the command would just be "telnet n7us.net". I think that would work anyways.
Or if you really want a script you would just need to create a file with:
Code:
#!/bin/sh
konsole -e telnet n7us.net
You could call it hamtelnet.sh or whatever. Make sure that you chmod +x on it and it should work.
-
Oops...sorry firebyrd...I got distracted with something and didn't see your post before I responded.
-
Senior Member
registered user
Code:
#!/bin/sh
konsole -e telnet n7us.net
No need for konsole arg. if you going to run it in konsole unless you want to open new konsole.
THe above command is suitable if you want to create link on your desktop but you need to remove the sh extension first. Make sure you change it to executable.
-
Senior Member
registered user
telnet script
Hello gentlemen...thank you for your help! I noticed in my KDE menu is another program called Telnet-ssl. I can save a stewp by using that, because when it is started, unlike the regular Konsole, the prompt is already at the TELNET point. Would i be able to substitute the word telnet in the below example with telnet-ssl?
#!/bin/sh
konsole -e telnet n7us.net
I want to try learning scripts but I still am not too sure about how to go about it. OK I will try this example when I get home and post my results....thank you...bob
-
Senior Member
registered user
correction!
Wow its too early in the morning! My last post had an error: What I would like to know, is in the below example:
Code:
#!/bin/sh
konsole -e telnet n7us.net
Can i take out the word Konsole and put in telnet-ssl? Telnet-ssl is another Konsole-type mode that, when started, is already at the telnet prompt....I am wondering if this will save me a step or two. I am very familiar with doing DOS batch files, but Linux scripts are very confusing! I would like to learn because knowing scripts would be a benefit. thanks...bob
-
Senior Member
registered user
Code:
#!/bin/sh
konsole -e telnet-ssl n7us.net
Don't think you can remove konsole because telnet run from konsole
-
Senior Member
registered user
If you want a gui version of telnet-ssh , try Putty. Just apt-get.
-
Senior Member
registered user
works great
Hello again....Yah I see what you mean about the Konsole and Telnet-ssl being one in the same! I did make the script and it runs great!
Thank you for the tip.....I do have another question....and I might be biting off alot more than I can chew with this one......considering my knowledge of shell scripts at the moment!
I would like to be able to create a MENU with a few simple Knoppix programs that will run in the terminal. I like making batch files in DOS and I would like to see if I can do the same thing using Linux. I have an older computer that would be perfect for this...to run in command line only.
If you are familiar with how to go about making a menu in dos using errorlevels and ANSI graphics.....I can do that very easily, but does anyone know how to code in linux to do something similar that will gun in a GUI - less environment? I can see now how to make a simple shell script and make it executable....but I have no clue where to start to creat a menu screen, using a box around it maybe with 4 or 5 menu choices in it....then when you pick. say the first choice on menu which is labeled "A" for example....the script finds the label and runs the program...then when you exit program, you are taken back to menu!
I know this may sound crazy but this is goodtherapy for me to keep the ol brain working! bob58
Similar Threads
-
By sunnmoon in forum General Support
Replies: 1
Last Post: 06-15-2005, 04:08 PM
-
By fmfischer in forum General Support
Replies: 1
Last Post: 04-14-2005, 11:07 AM
-
By irvine in forum The Lounge
Replies: 4
Last Post: 12-02-2004, 03:27 AM
-
By bikerman in forum General Support
Replies: 1
Last Post: 04-15-2004, 12:22 AM
-
By shadinio in forum Hardware & Booting
Replies: 1
Last Post: 03-25-2004, 09:09 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
![Knoppix NSM 1.2 picture](/store/img/g/btwAAOSwWpVlAOZn/s-l225/Knoppix-NSM-1-2.jpg)
Knoppix NSM 1.2
$8.00
![Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive picture](/store/img/g/I8UAAOSwdHdgiQtc/s-l225/Knoppix-Live-GNU-Linux-System-9-1-on-Bootable-CD-D.jpg)
Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive
$9.99
![KNOPPIX 9.1 LINUX INSTALL & LIVE DVD picture](/store/img/g/I3EAAOSwdEll-z0J/s-l225/KNOPPIX-9-1-LINUX-INSTALL-LIVE-DVD.jpg)
KNOPPIX 9.1 LINUX INSTALL & LIVE DVD
$9.99
![Linux Knoppix 4.0.2 Installation Disc picture](/store/img/g/jvgAAOSw2kVl3ru~/s-l225/Linux-Knoppix-4-0-2-Installation-Disc.jpg)
Linux Knoppix 4.0.2 Installation Disc
$29.99
![Knoppix Linux Bootable OS v8.6](/store/img/g/m9EAAOSwwL5fs9mY/s-l225/Knoppix-Linux-Bootable-OS-v8-6-Original-Live-Opera.jpg)
Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 32G USB Stick
$20.30
![Hamshack Live DVD-ROM picture](/store/img/g/Or0AAOSwsZpkY8PH/s-l225/Hamshack-Live-DVD-ROM.jpg)
Hamshack Live DVD-ROM
$8.00
![Acer Aspire One 9 inch Netbook ZG5 512MB RAM 8GB SSD HD Knoppix Linux WiFi VGA picture](/store/img/g/u1wAAOSwhBJljLXq/s-l225/Acer-Aspire-One-9-inch-Netbook-ZG5-512MB-RAM-8GB-S.jpg)
Acer Aspire One 9 inch Netbook ZG5 512MB RAM 8GB SSD HD Knoppix Linux WiFi VGA
$79.99
![Knoppix 3.4 Linux installation CD picture](/store/img/g/UqAAAOSwPf1mNj1O/s-l225/Knoppix-3-4-Linux-installation-CD.jpg)
Knoppix 3.4 Linux installation CD
$10.00
![Knoppix Linux Bootable OS v8.6](/store/img/g/m9EAAOSwwL5fs9mY/s-l225/Knoppix-Linux-Bootable-OS-v8-6-Original-Live-Opera.jpg)
Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 16G USB Stick
$19.95