10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team,
Not getting the file output inside my email which i am sending from unix box. . Please refer the below code :
#!/bin/sh
{
sleep 5
echo ehlo 10.56.185.13
sleep 3
echo mail from: oraairtel@CNDBMUREAPZP02.localdomain
sleep 3
echo rcpt to: saurabhtripathi@anniksystems.com... (1 Reply)
Discussion started by: tripathi1990
1 Replies
2. Shell Programming and Scripting
Hi All,
When i use sort Test, here is the output:
$ sort Test
a
b
b
c
d
e
f
g
h
i
But the contents in the file remain unsorted, how to do that?
]$ cat Test
g
i (6 Replies)
Discussion started by: chandrakanth
6 Replies
3. Shell Programming and Scripting
We have two files
file 1: (usually small, ~100 lines), each line contains a : separated index, value e.g
2: Apple
1: Banana
5: Pear
7: Orange
File 2: (usually large, 10 million lines or more), each line contains a single string value. e.g
xyz1
xyz2
xyz3
xyz4
xyz5
xyz6
xyz7
Now... (2 Replies)
Discussion started by: AlokKumbhare
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a very large file that contains a listing of all files on the system. I need to create a listing from that file of all files that start with the following format: s???_*, whereas the '?' represents characters, so the file name begins with an 's' followed by three other characters and... (4 Replies)
Discussion started by: tes218
4 Replies
5. Shell Programming and Scripting
hi
I have template file my.tpl:
bla-bla-bla
<link href="style.css" type="text/css">
bla-bla-bla
and style.css :
body{margin: 0px;}
I want to get in result one file:
bla-bla-bla
<script>body{margin: 0px;}</script>
bla-bla-bla
I tryed to used SED:
sed '/<link .*href=\"(*)*\"... (6 Replies)
Discussion started by: dim_nsk
6 Replies
6. Shell Programming and Scripting
Dear Unix Gurus,
I am new to shell scripting and in the process of learing.
I am trying to find whether a file name has today's date in MMDDYYYY format.
I am using the following code and it doesn't seem like working.
#!/usr/bin/ksh
today=$(date '+%m%d%Y')
echo today: $today
file=`find... (4 Replies)
Discussion started by: shankar1dada
4 Replies
7. UNIX for Dummies Questions & Answers
Hi ,
Is there any way i can find a file with specific word inside it.
For example if i want to find a file which has some text written inside it.
How would i form a command to search them? (3 Replies)
Discussion started by: pinga123
3 Replies
8. Shell Programming and Scripting
How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I barely know the basics, but I am very determined to learn. I want to parse a few characters from each row, use that string to search another file and display the line number where I found the value in the file. I don't know if this can all be done on the command line, so I am creating a... (2 Replies)
Discussion started by: SSims
2 Replies
10. Shell Programming and Scripting
Hi,
I'm a newbi in shell script. Here what I want to do:
FileA:
bor bor bor
xxxx
bib bib bi
FileB:
something something
something
I want to replace string "xxxx" in FileA with contents of FileB.
i tried with sed:
fileb=`cat FileB`
reg=xxxx
file=FileA (4 Replies)
Discussion started by: afatguy
4 Replies
Geometry(3) Tk Themed Widget Geometry(3)
__________________________________________________________________________________________________________________________________________________
NAME
Ttk_MakeBox, Ttk_PadBox, Ttk_ExpandBox, Ttk_PackBox, Ttk_StickBox, Ttk_PlaceBox, Ttk_BoxContains, Ttk_MakePadding, Ttk_UniformPadding,
Ttk_AddPadding, Ttk_RelievePadding, Ttk_GetPaddingFromObj, Ttk_GetBorderFromObj, Ttk_GetStickyFromObj - Tk themed geometry utilities
SYNOPSIS
#include <tkTheme.h>
Ttk_Box
Ttk_MakeBox(int x, int y, int width, int height);
Ttk_Box
Ttk_PadBox(Ttk_Box parcel, Ttk_Padding padding);
Ttk_Box
Ttk_ExpandBox(Ttk_Box parcel, Ttk_Padding padding);
Ttk_Box
Ttk_PackBox(Ttk_Box *cavity, int width, int height, Ttk_Side side);
Ttk_Box
Ttk_StickBox(Ttk_Box parcel, int width, int height, unsigned sticky);
Ttk_Box
Ttk_PlaceBox(Ttk_Box *cavity, int width, int height, Ttk_Side side, unsigned sticky);
Ttk_Box
Ttk_AnchorBox(Ttk_Box parcel, int width, int height, Tk_Anchor anchor);
Ttk_Padding
Ttk_MakePadding(short left, short top, short right, short bottom);
Ttk_Padding
Ttk_UniformPadding(short border);
Ttk_Padding
Ttk_AddPadding(Ttk_Padding padding1, Ttk_Padding padding2;
Ttk_Padding
Ttk_RelievePadding(Ttk_Padding padding, int relief);
int
Ttk_BoxContains(Ttk_Box box, int x, int y);
int
Ttk_GetPaddingFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Ttk_Padding *padding_rtn);
int
Ttk_GetBorderFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Padding *padding_rtn);
int
Ttk_GetStickyFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *sticky_rtn);
ARGUMENTS
Tk_Anchor anchor (in) One of the symbolic constants TK_ANCHOR_N, TK_ANCHOR_NE, etc. See Tk_GetAnchorFromObj(3).
Ttk_Box * cavity (in/out) A rectangular region from which a parcel is allocated.
short border (in) Extra padding (in pixels) to add uniformly to each side of a region.
short bottom (in) Extra padding (in pixels) to add to the bottom of a region.
Ttk_Box box (in)
Ttk_Box * box_rtn (out) Specifies a rectangular region.
int height (in) The height in pixels of a region.
Tcl_Interp * interp (in) Used to store error messages.
int left (in) Extra padding (in pixels) to add to the left side of a region.
Tcl_Obj * objPtr (in) String value contains a symbolic name to be converted to an enumerated value or bitmask. Inter-
nal rep may be be modified to cache corresponding value.
Ttk_Padding padding (in)
Ttk_Padding * padding_rtn (out) Extra padding to add on the inside of a region.
Ttk_Box parcel (in) A rectangular region, allocated from a cavity.
int relief (in) One of the standard Tk relief options (TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.). See Tk_GetRe-
liefFromObj.
short right (in) Extra padding (in pixles) to add to the right side of a region.
Ttk_Side side (in) One of TTK_SIDE_LEFT, TTK_SIDE_TOP, TTK_SIDE_RIGHT, or TTK_SIDE_BOTTOM.
unsigned sticky (in) A bitmask containing one or more of the bits TTK_STICK_W (west, or left), TTK_STICK_E (east, or
right, TTK_STICK_N (north, or top), and TTK_STICK_S (south, or bottom). TTK_FILL_X is defined as
a synonym for (TTK_STICK_W|TTK_STICK_E), TTK_FILL_Y is a synonym for (TTK_STICK_N|TTK_STICK_S),
and TTK_FILL_BOTH and TTK_STICK_ALL are synonyms for (TTK_FILL_X|TTK_FILL_Y). See also:
grid(n).
Tk_Window tkwin (in) Window whose screen geometry determines the conversion between absolute units and pixels.
short top (in) Extra padding at the top of a region.
int width (in) The width in pixels of a region.
int x (in) X coordinate of upper-left corner of region.
int y (in) Y coordinate of upper-left corner of region.
_________________________________________________________________
BOXES
The Ttk_Box structure represents a rectangular region of a window:
typedef struct {
int x;
int y;
int width;
int height;
} Ttk_Box;
All coordinates are relative to the window.
Ttk_MakeBox is a convenience routine that contsructs a Ttk_Box structure representing a region width pixels wide, height pixels tall, at
the specified x, y coordinates.
Ttk_PadBox returns a new box located inside the specified parcel, shrunken according to the left, top, right, and bottom margins specified
by padding.
Ttk_ExpandBox is the inverse of Ttk_PadBox: it returns a new box surrounding the specified parcel, expanded according to the left, top,
right, and bottom margins specified by padding.
Ttk_PackBox allocates a parcel width by height pixels wide on the specified side of the cavity, and shrinks the cavity accordingly.
Ttk_StickBox places a box with the requested width and height inside the parcel according to the sticky bits.
Ttk_PlaceBox combines Ttk_PackBox and Ttk_StickBox: it allocates a parcel on the specified side of the cavity, places a box of the
requested size inside the parcel according to sticky, and shrinks the cavity.
Ttk_AnchorBox places a box with the requested width and height inside the parcel according to the specified anchor option.
Ttk_BoxContains tests if the specified x, y coordinate lies within the rectangular region box.
PADDDING
The Ttk_Padding structure is used to represent borders, internal padding, and external margins:
typedef struct {
short left;
short top;
short right;
short bottom;
} Ttk_Padding;
Ttk_MakePadding is a convenience routine that contsructs a Ttk_Padding structure with the specified left, top, right, and bottom compo-
nents.
Ttk_UniformPadding constructs a Ttk_Padding structure with all components equal to the specified border.
Ttk_AddPadding adds two Ttk_Paddings together and returns a combined padding containing the sum of the individual padding components.
Ttk_RelievePadding adds an extra 2 pixels of padding to padding according to the specified relief. If relief is TK_RELIEF_SUNKEN, adds two
pixels at the top and left so the inner region is shifted down and to the left. If it is TK_RELIEF_RAISED, adds two pixels at the bottom
and right so the inner region is shifted up and to the right. Otherwise, adds 1 pixel on all sides. This is typically used in element
geometry procedures to simulate a "pressed-in" look for pushbuttons.
CONVERSION ROUTINES
Ttk_GetPaddingFromObj converts the string in objPtr to a Ttk_Padding structure. The string representation is a list of up to four length
specifications "left top right bottom". If fewer than four elements are specified, bottom defaults to top, right defaults to left, and top
defaults to left. See Tk_GetPixelsFromObj(3) for the syntax of length specifications.
Ttk_GetBorderFromObj is the same as Ttk_GetPaddingFromObj except that the lengths are specified as integers (i.e., resolution-dependant
values like 3m are not allowed).
Ttk_GetStickyFromObj converts the string in objPtr to a sticky bitmask. The string contains zero or more of the characters n, s, e, or w.
SEE ALSO
Tk_GetReliefFromObj(3), Tk_GetPixelsFromObj(3), Tk_GetAnchorFromObj(3)
KEYWORDS
geometry, padding, margins, box, region, sticky, relief
Tk 8.5 Geometry(3)