CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - General Support
  text user interface to configure text files

 

 Bottom   Previous Topic   Next Topic
12>
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  londonnet
      londonnet
text user interface to configure text files
#1
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
I would like to write a text user interface (TUI) to adjust some text config files etc.

Is there a tool or application for creating TUIs like this.

I’m talking about those types of config tools which you see executed at first boot.

Any ideas?
Posted on: 2009/11/5 19:56
Create PDF from Post Print
Top
  •  pjwelsh
      pjwelsh
Re: text user interface to configure text files
#2
Professional Board Member
Joined: 2007/1/7
From Central IL USA
Posts: 1967
One possible option is "dialog" "A utility for creating TTY dialog boxes"
Posted on: 2009/11/5 21:15
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: text user interface to configure text files
#3
Moderator
Joined: 2006/12/13
From Tidewater Virginia, North America
Posts: 3404
You could also have a look at the source code for things like firstboot and system-config-securitylevel-tui.
_________________
Phil
Required reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2009/11/6 1:43
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#4
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
Thanks for the info. Dialog looks perfect for my needs.

I also found SNACK but dialog looks a better fit for this project.

All this said I got dialog working on one test host but ever since I can't install it and get it to perform corectly

when I try and run a script I get the following message

.rror: Unkown option
Use --help to list options.

line 4: --msgbox: command not found

Any thoughts?

the same script works on one box but not the other??????

Confused
Posted on: 2009/11/10 14:58
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: text user interface to configure text files
#5
Moderator
Joined: 2006/12/13
From Tidewater Virginia, North America
Posts: 3404
[root@hazardous ~]# locate msgbox
/usr/share/doc/dialog-1.0.20051107/samples/msgbox
/usr/share/doc/dialog-1.0.20051107/samples/msgbox1
/usr/share/doc/dialog-1.0.20051107/samples/msgbox2
/usr/share/doc/dialog-1.0.20051107/samples/msgbox3
/usr/share/doc/dialog-1.0.20051107/samples/msgbox4-8bit
/usr/share/doc/dialog-1.0.20051107/samples/msgbox5
/usr/share/doc/dialog-1.0.20051107/samples/msgbox6
/usr/share/doc/dialog-1.0.20051107/samples/msgbox6a
/usr/share/tk8.4/msgbox.tcl
/usr/share/tk8.4/demos/msgbox.tcl
/usr/src/kernels/2.6.18-128.2.1.el5-i686/scripts/kconfig/lxdialog/msgbox.c
/usr/src/kernels/2.6.18-128.4.1.el5-i686/scripts/kconfig/lxdialog/msgbox.c
/usr/src/kernels/2.6.18-128.7.1.el5-i686/scripts/kconfig/lxdialog/msgbox.c
/usr/src/kernels/2.6.18-164.6.1.el5-i686/scripts/kconfig/lxdialog/msgbox.c
/usr/src/kernels/2.6.18-164.el5-i686/scripts/kconfig/lxdialog/msgbox.c
[root@hazardous ~]# which msgbox
/usr/bin/which: no msgbox in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@hazardous ~]# rpm -qf /usr/share/tk8.4/msgbox.tcl
tk-8.4.13-5.el5_1.1
[root@hazardous ~]# rpm -qf /usr/share/doc/dialog-1.0.20051107/samples/msgbox
dialog-1.0.20051107-1.2.2

Is tk installed on both systems?
_________________
Phil
Required reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2009/11/10 15:33
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#6
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
on the last command
rpm -qf /usr/share/doc/dialog-1.0.20051107/samples/msgbox dialog-1.0.20051107-1.2.2

this compeates on the box that doesn't work other than that the other commands return the same results although they are no the same as the result listed?

????
Posted on: 2009/11/10 19:19
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: text user interface to configure text files
#7
Moderator
Joined: 2006/12/13
From Tidewater Virginia, North America
Posts: 3404
"compeates"? Sorry we seem to have a language barrier - I'm not following you at all.

What does "rpm -q tk" show on both boxes?
_________________
Phil
Required reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2009/11/10 19:48
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#8
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
Apologies
The last command completes on the system that doesn’t work and returns the following results
xxxx.RPM Is not owned by any packages
The same command does not auto complete on the system that does work and so has not returned any results!

Even though I am English a few beers later, etc …..

Moscow steak $120, advice on centos.org priceless….
Posted on: 2009/11/10 20:09
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#9
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
rpm -q tk the same on both.
Posted on: 2009/11/10 20:20
Create PDF from Post Print
Top
  •  pjwelsh
      pjwelsh
Re: text user interface to configure text files
#10
Professional Board Member
Joined: 2007/1/7
From Central IL USA
Posts: 1967
Post your script. I bet you have an error/wrong quote/other error.
Posted on: 2009/11/10 20:32
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#11
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
The test script is super simple and is the same on both host including file properterys as far as I can tell.

#!/bin/sh
# First shell script with "dialog"
dialog --title "Dialog message box" \
--msgbox "\n Hello world !" 6 25
Posted on: 2009/11/10 20:37
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#12
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
Hang on.... you may have somthing there, just cut and past the text via an ssh session on both hosts and the same script now works.

Stupid question but what hidden charicters (I assume carrage returns or somthing) are diferent? ????
Posted on: 2009/11/10 20:49
Create PDF from Post Print
Top
  •  pjwelsh
      pjwelsh
Re: text user interface to configure text files
#13
Professional Board Member
Joined: 2007/1/7
From Central IL USA
Posts: 1967
You may need to escape the "!" when using shell like "\!".
Posted on: 2009/11/10 21:00
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#14
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
Maybe file permissions.

Run a stat on the file .sh files and have the following results.

[root@localhost INSTALL]# stat 1.sh
File: `1.sh'
Size: 127 Blocks: 8 IO Block: 4096 regular file
Device: 802h/2050d Inode: 1465947 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2009-11-10 18:17:00.000000000 +0000
Modify: 2009-11-10 18:16:55.000000000 +0000
Change: 2009-11-10 18:16:55.000000000 +0000
[root@localhost INSTALL]# stat 2.sh
File: `2.sh'
Size: 125 Blocks: 8 IO Block: 4096 regular file
Device: 802h/2050d Inode: 1465950 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2009-11-10 18:16:15.000000000 +0000
Modify: 2009-11-10 17:49:35.000000000 +0000
Change: 2009-11-10 17:49:35.000000000 +0000

2 works and was past form the working host.
Posted on: 2009/11/10 21:21
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#15
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
ignore permisions.
Posted on: 2009/11/10 21:36
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#16
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
Yes, struggling to understand what I am doing wrong.

I think it maybe somthing fundimental to bash scripts or to diaog.

Anyone have any ideas or areas I should investigate?

Many thanks
Posted on: 2009/11/11 16:04
Create PDF from Post Print
Top
  •  pjwelsh
      pjwelsh
Re: text user interface to configure text files
#17
Professional Board Member
Joined: 2007/1/7
From Central IL USA
Posts: 1967
Back up for a moment... does the output of
sestatus |grep mode
show "enforcing"? If so, check your /var/log/messages files for info regarding selinux issues.
Work fine even with "!" in your test script.
Posted on: 2009/11/11 18:36
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#18
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
This command does not return any text.

I have tried putting ! in the script and this does not make any diference

the odd thig is that if I cut and past the simple script from the working system to the non working system the script works.

What I'm doing wrong must be super stupid.
Posted on: 2009/11/12 9:21
Create PDF from Post Print
Top
  •  londonnet
      londonnet
Re: text user interface to configure text files
#19
Peeking in the Member Window
Joined: 2009/8/4
From
Posts: 25
just a bit more info.

I have the following statment in my kickstart on both systems

# SELinux configuration
selinux --disabled
Posted on: 2009/11/12 9:23
Create PDF from Post Print
Top
  •  pjwelsh
      pjwelsh
Re: text user interface to configure text files
#20
Professional Board Member
Joined: 2007/1/7
From Central IL USA
Posts: 1967
Quote:

londonnet wrote:
This command does not return any text.


As you discovered, that just means it selinux is not running at all.

Have you added any custom items to your .bashrc like aliases or export's? Have you tried more than one user on the system? This is odd...
Posted on: 2009/11/12 13:42
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic
12>

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com