LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Combining 2 command lines (https://www.linuxquestions.org/questions/programming-9/combining-2-command-lines-244022/)

satimis 10-17-2004 11:53 PM

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

Tinkster 10-18-2004 12:21 AM

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

randyding 10-18-2004 12:52 AM

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.

satimis 10-18-2004 01:13 AM

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

satimis 10-18-2004 06:10 AM

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

randyding 10-18-2004 07:44 PM

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.

satimis 10-18-2004 09:40 PM

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


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