LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2009, 02:55 PM   #1
pr0xibus
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 215

Rep: Reputation: 44
scripting


right i am doing a small script for something it goes like
Code:
echo "enter device"
read device2
konsole **** -i $device2 
konsole **** -i $device2
konsole **** -i $device2
konsole **** -i $device2

where **** is the program name

after entering a device name how can i then open another shell and run the command **** -i $device2 i tried konsole && **** -i $device2
but that doesnt work any ideas

Cheers
 
Old 01-23-2009, 03:13 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I couldn't make konsole work the way you apparently want it to. How about using xterm, instead?
Code:
xterm -e "***** -i $device" &
--- rod.
 
Old 01-23-2009, 03:16 PM   #3
pr0xibus
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 215

Original Poster
Rep: Reputation: 44
works just as good bloody excellent cheers min
 
Old 01-23-2009, 03:23 PM   #4
pr0xibus
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 215

Original Poster
Rep: Reputation: 44
actually since i want a few running at once i got an error
Warning: Cannot convert string "nil2" to type FontStruct
xterm: unable to open font "-Misc-Fixed-Medium-R-Normal--20-200-75-75-C-100-ISO10646-1", trying "fixed"....

it will run the first command but the second stay on hold any past this
 
Old 01-23-2009, 03:26 PM   #5
pr0xibus
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 215

Original Poster
Rep: Reputation: 44
here is the script
Code:
#!/bin/bash
# Ettercapstuff

echo

echo "IP "
read ip1
echo "Gateway "
read gateway1
echo "Please Enter Device "
read device1



xterm -e **** -T -Q -M arp:remote -i $device1 /$ip1/ /$gateway1/
xterm -e **** -i $device1
xterm -e **** -i $device1
xterm -e **** -i $device1
xterm -e **** -i $device1
 
Old 01-23-2009, 03:40 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Try enclosing the program name plus all of its arguments in double quotes. It makes it look like a single argument to the '-e' option. Also, you will need to background each of the xterm commands, otherwise the will only run when the previous xterm has terminated. That is the purpose of the trailing '&' in my example.
--- rod.
 
Old 01-23-2009, 04:04 PM   #7
pr0xibus
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Slackware
Posts: 215

Original Poster
Rep: Reputation: 44
i put xterm -e "***** -T -Q -M arp:remote -i $device1 /$ip1/ /$gateway1/" $

and the xterm came up but it said

cant execvp ***** _t _Q "rest of program" no such file or directory
 
Old 01-23-2009, 04:36 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It cannot find the execuatble you are trying to launch. Try providing a full absolute filespec: '/usr/local/hortyflorty -T -Q blah blah'

I tried:
Code:
xterm -e "ZZZscreen -x" &
Since ZZZscreen doesn't exist, I got (in the xterm):
Code:
xterm: Can't execvp ZZZscreen: No such file or directory
--- rod.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting atul_sp Linux - Server 1 02-04-2008 11:45 PM
new in scripting bob4linux Programming 10 10-27-2007 05:54 PM
Scripting help please Decorte Linux - Newbie 3 10-21-2007 06:31 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
Scripting Help Please Jazinator Linux - Newbie 7 10-17-2004 06:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration