LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-11-2003, 02:09 PM   #1
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Rep: Reputation: 31
run 2 commands in a script


I have been messing with this for a while. Just can't figure out how to make this work. I know it is something simple but no go for me. Here is what I am trying to do.

I want to run a program called wy60 and then telnet into my server.

I put this in the file and made it executable:

wy60 &
telnet 10.1.1.235

I run the file and it will telnet into my server but the wy60 program is not running so I am unable to work because of the garbage.

If I go to konsole and manually type:

wy60

and then

telnet 10.1.1.235

It works perfect.

Can someone tell me what I am not doing right?

Thanks,
Dave
 
Old 06-11-2003, 02:31 PM   #2
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
When you say you type wy60 and then telnet 10.1.1.235 are you saying that wy60 detaches itself from the console and goes into some form of daemon mode? If so why are you using the ampersand in the script to detach it?

Flibble
 
Old 06-11-2003, 02:39 PM   #3
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Original Poster
Rep: Reputation: 31
wy60 is just a wy60 emulator. My server has to have wy60 emulation.

I put the & after searching around for how to run more than one command. That was a guess. Without the & the script does not continue to the telnet 10.1.1.235

All i'm trying to do is run 2 commands from one file so all I have to do is setup a shortcut to that one executable file.

Thanks,
Dave
 
Old 06-11-2003, 02:55 PM   #4
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Original Poster
Rep: Reputation: 31
Just had a thought. Sorry for the comparison but.......

I am wanting to do something like a BATCH file in DOS.

Dave
 
Old 06-11-2003, 03:06 PM   #5
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
When you go to a console and type wy60 what exactly happens? Does a GUI start, do you get control back immediately to the console. i.e. can you then immediately type another command?

Flibble
 
Old 06-11-2003, 03:07 PM   #6
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Original Poster
Rep: Reputation: 31
Ok, after more searching. I changed my script to this:

#!/bin/bash
wy60
telnet 10.1.1.235

But, still have the same problem. It will execute the wy60 but not the telnet command.

Dave
 
Old 06-11-2003, 03:10 PM   #7
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Original Poster
Rep: Reputation: 31
Sorry, i was typing at the same time.

After typing wy60 at the command line I get control back. I then can type the telnet command.

No GUI starts just the command line.

The wy60 is only changing the term setting in the konsole to wy60 emulation.

Maybe it is because it is changing the term settings?

Dave
 
Old 06-11-2003, 03:13 PM   #8
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
Why don't you just export your TERM then?

i.e.

export TERM=wy60
telnet 10.1.1.235

Flibble
 
Old 06-11-2003, 03:23 PM   #9
ddpicard
Member
 
Registered: Oct 2001
Location: Texas
Distribution: Slackware 13
Posts: 214

Original Poster
Rep: Reputation: 31
That was what I was trying to do in the begining. But it will not change the term to wy60. I was trying wy50 also in the begining but would not work.

I did a search on google and found http://www.gutschke.com/wy60 compiled it and it works great. Just can't seem to automate it with a script.

BTW, thanks for all the ideas.

Dave
 
Old 06-13-2003, 04:45 PM   #10
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
Looks like the entry should be:

export TERM=wyse60

rather than:

export TERM=wy60

Give that a whirl and let me know.

Flibble
 
Old 06-13-2003, 04:50 PM   #11
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
Also you may want to try the following with your emulator you just compiled:

wy60 -c telnet 10.1.1.235

This should invoke telnet with wy60 support if I'm reading the man page right. The default is just to spawn a shell with the support.

Flibble
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to create a script to open a terminal and run commands in it. Brian1 Linux - Software 6 02-07-2005 06:46 PM
no commands run astroboiii Linux - General 2 01-08-2005 07:40 PM
Script to Run the Same Commands on a List of Files Chryzmo Programming 1 10-03-2004 08:34 AM
Creating a script to run two commands anjaan Programming 11 06-15-2004 02:51 AM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM


All times are GMT -5. The time now is 03:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration