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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-17-2004, 11:53 PM
|
#1
|
|
Senior Member
Registered: Apr 2003
Posts: 3,218
Rep:
|
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
|
|
|
|
10-18-2004, 12:21 AM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,916
|
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
|
|
|
|
10-18-2004, 12:52 AM
|
#3
|
|
Member
Registered: May 2004
Posts: 552
Rep:
|
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.
|
|
|
|
10-18-2004, 01:13 AM
|
#4
|
|
Senior Member
Registered: Apr 2003
Posts: 3,218
Original Poster
Rep:
|
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
|
|
|
|
10-18-2004, 06:10 AM
|
#5
|
|
Senior Member
Registered: Apr 2003
Posts: 3,218
Original Poster
Rep:
|
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
|
|
|
|
10-18-2004, 07:44 PM
|
#6
|
|
Member
Registered: May 2004
Posts: 552
Rep:
|
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.
|
|
|
|
10-18-2004, 09:40 PM
|
#7
|
|
Senior Member
Registered: Apr 2003
Posts: 3,218
Original Poster
Rep:
|
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:50 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|