I have a file that has a list of entries in a column
x
z
z
z
x
y
z
The column can have any length and any number of any strings. I need to replace each unique string with a user defined number. I can filter the unique entries out using
awk '{if (NF==5) print $2}' file | uniq | nl >... (1 Reply)
In a line such as:
echo -n "How many days back would you like to check? "; read days
How can I ensure that the user has a.) entered a number between 1-30 (not 0 or 31+) and b.) has not just hit enter (ie set it to "") and if it's entered wrong, how do I start the if statement over?
I... (10 Replies)
Hi ,
I had a script in which there is a variable $LOG defined and I want to check where that variable is getting value from, is there a way I can check for that variable and it's value if it is defined in some other script function or script . I checked using command env and also export... (1 Reply)
Hi,
I have a user defined variable _TIME1=xxx
I am using awk command for pattern matching.
cat $_LOCATION/catalina.txt | awk '/^`$_TIME1`:??:??/'
It not taking the value of $_TIME!
eg:I am using the command to get all the patter from 12:00:00 to 12:59:59
The user defined variable... (2 Replies)
HI. I had an environment variable defined in my .bash_profile file and I deleted it. I opened a new terminal and looked inside .bash_profile and it's not there but when I type
printenv MYCONFIG
it reutrns what the value used to be in my .bash_profile still!! I did a grep for MYCONFIG and... (6 Replies)
Hi Guys,
I have one text file ABC.txt...It have 3 lines
List=/home/klk/dir/ABC.txt
Leajnk123
KJUHIO1234
IJOKIJ7676
I want use as different variable of each line.Just like
X=firstline
Y=Secound Line
Z=Third Line (4 Replies)
Hi, guys,
The content of file is below (from <UNIX® Shells by Example Fourth Edition>):
My code is below:
gawk -F'' ' { OFS = "****"; $3 = "(904)"; $8 = $5 + $6 + $7; print } ' lab3.data
The result is below:
So, where is the $1? Why is the variable $8 located at the wired position? (3 Replies)
I'm a BASH shell user (relatively new)
I need to get a variable calculated in a subshell, outside the subshell, when it completes. I can do it, by writing the variable into a file, and then reading the file again when outside the subshell. I've tried lots of things from exporting to environmental... (3 Replies)
Hi,
diffcount=`awk 'BEGIN { while ( getline < "/scripts/matt/text.server1.reference" ) { arr++ } } { if (!( $0 in arr ) ) { print } }' $TMPDIR/$(basename $0 .sh) | wc -l`
if ]; then
OK="OK - No change in the interfaces status"
elif ]; then
DIFF=`awk 'BEGIN {... (4 Replies)
Discussion started by: nms
4 Replies
LEARN ABOUT MOJAVE
itk
itk(n) [incr Tk] itk(n)
__________________________________________________________________________________________________________________________________________________NAME
itk - framework for building mega-widgets in Tcl/Tk
_________________________________________________________________DESCRIPTION
Mega-widgets are high-level widgets that are constructed using Tk widgets as component parts, usually without any C code. A fileselection-
box, for example, may have a few listboxes, some entry widgets and some control buttons. These individual widgets are put together in a
way that makes them act like one big widget. A fileselectionbox mega-widget can be created with a command like:
fileselectionbox .fsb -background blue -foreground white
Once it has been created, it can be reconfigured with a command like:
.fsb configure -background green -foreground black
and all of its internal components will change color. Each mega-widget has a set of methods that can be used to manipulate it. For exam-
ple, the current selection can be queried from a fileselectionbox like this:
set fileName [.fsb get]
In effect, a mega-widget looks and acts exactly like a Tk widget, but is considerably easier to implement.
[incr Tk] is a framework for building mega-widgets. It uses [incr Tcl] to support the object paradigm, and adds base classes which provide
default widget behaviors.
All [incr Tk] widgets are derived from the Archetype base class. This class manages internal component widgets, and provides methods like
"configure" and "cget" to access configuration options.
The Widget base class inherits everything from Archetype, and adds a Tk frame which acts as a container for the mega-widget. It is used to
build mega-widgets that sit inside of other frames and toplevels. Derived classes create other internal components and pack them into the
"hull" frame created by the Widget base class.
The Toplevel base class inherits everything from Archetype, but adds a Tk toplevel which acts as a container for the mega-widget. It is
used to build mega-widgets, such as dialog boxes, that have their own toplevel window. Derived classes create other internal components
and pack them into the "hull" toplevel created by the Toplevel base class.
[incr Widgets] LIBRARY
[incr Widgets] is a mega-widget library built using [incr Tk]. It can be used right out of the box, and contains more than 30 different
widget classes, including:
- fileselectiondialog
- tabnotebook
- panedwindow
- combobox
- optionmenu
- scrolledlistbox
- scrolledframe
- messagedialog
- and many others...
The catalog demo in the "iwidgets/demos" directory shows all of the available widgets in action. Each widget class has its own man page
describing the features available.
KEYWORDS
class, object, object-oriented, mega-widget
itk 3.0 itk(n)