LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-08-2009, 12:39 PM   #1
tihcas
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian/Ubuntu
Posts: 3

Rep: Reputation: 0
Can we use a Dialog or xDialog script to edit another shellscript


I am Linux shellscript newbie.

Would like to know if we could use a dialog or xDialog script to read and display the current values of the variables in another shellscript and input or edit and save user defined variables back in that shellscript ?


I have written a shellscript to launch a rdesktop session.

In the shellscript I have defined the rdesktop parameters like username, password, application as user defined variables.

I would like to use another script using xDialog or Dialog to read and display these variables, enter/edit and save these variables back in the shellscript.

Thanks
SB

Last edited by tihcas; 01-08-2009 at 01:26 PM.
 
Old 01-08-2009, 02:24 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Hi, and welcome to LQ!

And yes, you can. You just need to be good with sed or awk
to achieve the task at hand.


Cheers,
Tink
 
Old 01-08-2009, 04:20 PM   #3
tihcas
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian/Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you Tinkster.

Any good tutorials/books with examples for scripting with sed or awk that you would recommend? From some brief research I find both these tools are for text manupilation.

I would like to be able to create an independent script with xdialog, which when executed, will read the values from the second script(input variables shown below). The goal is to have a gui so that the user can input and save values in the second script without having to touch the second script file.

#!/bin/sh
rdpserver=w.x.y.z
rdpuser='-u test'
rdppasswd='-p test'
rdpdomain='-d test'
application='-s notepad.exe'
appworkdir='c:\windows'

rdesktop -f '$rdpdomain' '$rdpuser' '$rdppasswd' '$application' -c '$appworkdir' '$rdpserver'

Any help with an example would be greatly appreciated.

Regards

Quote:
Originally Posted by Tinkster View Post
Hi, and welcome to LQ!

And yes, you can. You just need to be good with sed or awk
to achieve the task at hand.


Cheers,
Tink
 
Old 01-08-2009, 09:14 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Awk: http://www.grymoire.com/Unix/Awk.html
Sed: http://www.grymoire.com/Unix/Sed.html
 
Old 01-09-2009, 11:24 AM   #5
tihcas
LQ Newbie
 
Registered: Jan 2009
Distribution: Debian/Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you Chris.

I went through the tutorials.

I am an absolute scripting newbie and looking at the sed tutorials I am beginning to think I have Dyslexia :-)

I am fighting a deadline to install a few Debain linux based PCs for a small business and I need this script.

Can some one write a script for me as a freelancer ?

I am not sure if this request is against the forum rules. If it is I apolozise.




Quote:
Originally Posted by chrism01 View Post
 
  


Reply

Tags
dialog, xdialog


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
Need help with dialog(Xdialog) --gauge option zackarya Programming 7 09-02-2010 04:25 AM
converting shell script from "dialog" to "xdialog" kushalkoolwal Programming 1 02-25-2008 09:40 PM
LXer: CLI Magic: Creating basic front ends with dialog and Xdialog LXer Syndicated Linux News 0 07-17-2006 10:21 AM
shell script with dialog sqn Programming 3 04-08-2004 03:25 PM
Simple script in Xdialog.. help pawellt Programming 1 12-17-2003 02:41 AM


All times are GMT -5. The time now is 04:51 PM.

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