10-05-2011
Quote:
Originally Posted by
gary_w
I started messing around with a hangman game too for the fun of it after reading a posting here somewhere by Corona688 that gave an example on manipulating strings.
May I suggest you use anything other than the dash shell? maybe bash or ksh -- even busybox
ash is better.
I also don't understand why you put BASH in the title when you don't have it. Not all shells are BASH. Only BASH is BASH.
dash is designed as a minimal shell for startup scripts, which intentionally lacks nearly all the features which make a shell nice to program in.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am trying to write a shell script designed to take input line by line by line from a file with a word on each line for editing with sed. Example file:
1.ejverything
2.bllown
3.maikling
4.manegement
5.existjing
6.systems
My design currently takes input from the user, and... (2 Replies)
Discussion started by: mkfitzwilliams
2 Replies
3. Shell Programming and Scripting
Hello Experts,
I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn.
AIM: The script has some commented and some uncommented lines. I need to :
... (2 Replies)
Discussion started by: hkansal
2 Replies
4. Shell Programming and Scripting
I have several files that I need to modify using sed. I know how to do that, but now a new requirement has come up.
Now, I need to make changes to all lines that don't start with certain strings. For example, I need to change all lines except for lines that start with "a", "hello there",... (3 Replies)
Discussion started by: RickS
3 Replies
5. Shell Programming and Scripting
Hi,
I've got a file with 3 columns which ends like this:
...
1234 345 1400
5287 733 1400
8472 874 1400
9317 726 1400
I want to replace the last row of the last column with the value 0. So my new file will end:
...
1234 345 1400
5287 733 1400
8472 874 1400
9317 726 ... (5 Replies)
Discussion started by: jhunter87
5 Replies
6. Shell Programming and Scripting
Hi,
I require to replace 2 items:
1. replace start of all lines in a file with ' except the first line
2. replace end of all lines in a file with '||chr( except last line
I am able to do the entire file using
sed -e s/^/\'/g -e s/$/\'\|\|chr\(/g "$file" > newfile.txt
but am not yet able... (0 Replies)
Discussion started by: Chella15
0 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I require to replace 2 items:
1. replace start of all lines in a file with ' except the first line
2. replace end of all lines in a file with '||chr( except last line
I am able to do the entire file using
sed -e s/^/\'/g -e s/$/\'\|\|chr\(/g "$file" > newfile.txt
but am not yet... (3 Replies)
Discussion started by: Chella15
3 Replies
8. Shell Programming and Scripting
I need to use a shell script, using sed command how to replace date variable value in following format.
04/18/2012 11:38:55
Because the sed is treating the '/' as a parameter instead of the value of a variable, and hence there is the message as
sed: command garbled: s/insert/04/18/2012... (9 Replies)
Discussion started by: jannusuresh
9 Replies
9. UNIX for Beginners Questions & Answers
My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data.
... (7 Replies)
Discussion started by: chandrath
7 Replies
10. UNIX for Advanced & Expert Users
File is pipe delimited with 17 fields. We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n in data with space and not the Ture \n that is line separator.
I tried below awk command it did not work as expected.
awk '(NR-1)%2{$1=$1}1' RS=\|... (9 Replies)
Discussion started by: rajeshkumare
9 Replies
LEARN ABOUT HPUX
xsetdashes
XSetDashes() XSetDashes()
Name
XSetDashes - set a pattern of line dashes in a graphics context.
Synopsis
XSetDashes(display, gc, dash_offset, dash_list, n)
Display *display;
GC gc;
int dash_offset;
char dash_list[];
int n;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
gc Specifies the graphics context.
dash_offset
Specifies the phase of the pattern for the dashed line style.
dash_list Specifies the dash list for the dashed line style. An odd-length list is equivalent to the same list concatenated with itself to
produce an even-length list.
n Specifies the length of the dash list argument.
Description
XSetDashes() sets the dashes component of a GC. The initial and alternating elements of the dash_list argument are the dashes, the others
are the gaps. All of the elements must be non-zero, with lengths measured in pixels. The dash_offset argument defines the phase of the
pattern, specifying how many pixels into the dash_list the pattern should actually begin in the line drawn by the request.
n specifies the length of dash_list. An odd value for n is interpreted as specifying the dash_list concatenated with itself to produce
twice as long a list.
Ideally, a dash length is measured along the slope of the line, but server implementors are only required to match this ideal for horizon-
tal and vertical lines. Failing the ideal semantics, it is suggested that the length be measured along the major axis of the line. The
major axis is defined as the x axis for lines drawn at an angle of between -45 and +45 degrees or between 315 and 225 degrees from the x
axis. For all other lines, the major axis is the y axis.
See Volume One, Chapter 5, The Graphics Context, for further information.
Errors
BadAlloc
BadGC
BadValue No values in dash_list.
Element in dash_list is 0.
See Also
XDefaultGC(), XChangeGC(), XCopyGC(), XCreateGC(), XFreeGC(), XGContextFromGC(), XSetArcMode(), XSetBackground(), XSetClipMask(), XSetCli-
pOrigin(), XSetClipRectangles(), XSetFillRule(), XSetFillStyle(), XSetForeground(), XSetFunction(), XSetGraphicsExposures(), XSetLineAt-
tributes(), XSetPlaneMask(), XSetState(), XSetStipple(), XSetSubwindowMode(), XSetTSOrigin().
Xlib - Graphics Context XSetDashes()