LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-17-2004, 11:53 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Rep: Reputation: 52
Combining 2 command lines


Hi folks,

I need to combine following 2 command lines

a)
xterm -e su
(to start xterm window for password to login as root)

b)
xterm -hold -T "CDMaker by satimis" -e /home/satimis/burncd_01
(to start xterm window for entries to burn CD)

I tried following combinations without success;

xterm -hold -T "CDMaker by satimis" -e "su /home/satimis/burncd_01"
xterm -hold -T "CDMaker by satimis" -e `su /home/satimis/burncd_01`
(back tick)
xterm -T "CDMaker by satimis" -e 'su /home/satimis/burncd_01`

Please advise

TIA

B.R.
satimis
 
Old 10-18-2004, 12:21 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
I can't make too much sense of this - what are
you actually trying to achieve?

I understand that you want to open an xterm with
a particular title, but then what's meant to happen?


Cheers,
Tink
 
Old 10-18-2004, 12:52 AM   #3
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
xterm -hold -T 'my title' -e "su -c 'echo hello'"

The line above ends with a single quote then a double quote, with my fonts at least its hard to see it.
 
Old 10-18-2004, 01:13 AM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Quote:
Originally posted by Tinkster
I can't make too much sense of this - what are
you actually trying to achieve?

I understand that you want to open an xterm with
a particular title, but then what's meant to happen?
Hi Tinkster,

Tks for your response.

I need to run the script on root's xterm window with root password. The command line is embedded on an ICON to be evoked with a click.

I tried the combinations as mentioned in my previous posting but either could not start xterm window, or can't input on it even started, or xterm window started and closed immediately.

Single command line works (i.e. both of them work separately). If I login as root then I can run the second command line without problem

B.R.
satimis
 
Old 10-18-2004, 06:10 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Quote:
Originally posted by randyding
xterm -hold -T 'my title' -e "su -c 'echo hello'"

The line above ends with a single quote then a double quote, with my fonts at least its hard to see it.
Hi randyding,

Tks for your advice. Your command line worked for me with little adjustment as follow;

xterm -hold -T "CDMaker by satimis" -e "su -c /home/satimis/burncd_01"

Now with a click on a desktop icon I can burn a CD including all pre-selected directories plus directories input later.

The remaining job is how to automatically delete the ISO image thus created and to close the xterm window after all steps completed . Any hint?

TIA

B.R.
satimis
 
Old 10-18-2004, 07:44 PM   #6
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
First, you don't need to be root to use cdrecord, there are other things in your system configuration that can be done to fix this problem.

Second, the argument to su -c 'something', something can be a shell script that first calls cdrecord, then it can do the cleanup tasks you want.

Also I would't delete .iso image until I verify the CD burned correctly.
 
Old 10-18-2004, 09:40 PM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi randyding,

Tks for your advice.

I'm trying to build up my knowledge on script, learning other alternatives apart from

chown root:wheel /usr/bin/cdrecord
edit /etc/group add 'satimis' to 'wheel' group

In real application I'll edit the script adding 'su' and 'rm ISO image' on it.

B.R.
satimis
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command erase lines paraiso Linux - Newbie 4 05-12-2005 10:48 AM
combining multiple dsl lines BaudRacer General 3 01-12-2004 09:15 AM
Grip command lines linuxtakemeaway Linux - Newbie 5 02-03-2003 01:11 PM
Executing command lines in C/C++ ReverseLogic Programming 2 05-28-2002 02:08 PM
command lines? rockin chair Linux - General 5 04-28-2002 10:48 PM


All times are GMT -5. The time now is 01:01 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