LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can we use a Dialog or xDialog script to edit another shellscript (http://www.linuxquestions.org/questions/linux-newbie-8/can-we-use-a-dialog-or-xdialog-script-to-edit-another-shellscript-695870/)

tihcas 01-08-2009 12:39 PM

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

Tinkster 01-08-2009 02:24 PM

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

tihcas 01-08-2009 04:20 PM

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 (Post 3401430)
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


chrism01 01-08-2009 09:14 PM

Awk: http://www.grymoire.com/Unix/Awk.html
Sed: http://www.grymoire.com/Unix/Sed.html

tihcas 01-09-2009 11:24 AM

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 (Post 3401788)



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