-
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

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

Intel Xeon W-2255 SRGV8 3.7GHz 10-Core LGA2066 Server CPU Processor
$199.99

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD
$275.00

Lenovo ThinkStation P520 Intel Xeon W-2123 3.6GHz 900W - NO RAM/ GPU/ HDD/ OS
$189.98

Dell Precision T5820 950W Workstation 4.00GHz W-2125 No RAM/ GPU/ HDD/ OS
$144.98

Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS
$84.49

Intel Xeon E5-2690v2 SR1A5 10-Core 3.00GHz 25MB 130W LGA2011 CPU *km
$11.99

Intel Xeon Gold 6230 2.1 GHz Processor - SRF8W
$29.00

Matched Pair _ Intel Xeon E5-2698 V4 2.2GHz 20-Core Processor CPU LGA2011 SR2JW
$94.99

Intel Xeon Processor E5-2687W V4 SR2NA 3.00GHz Broadwell 160W LGA2011 12-Core
$36.00

Dell PowerEdge FC430 Blade Server 2x Xeon E5-2630v4 20 Cores FX2 FX2s No RAM/HDD
$119.99