Sponsored Content
Top Forums Shell Programming and Scripting Comp-3 conversion possible with Shell Scripting or PERL? Post 68039 by Perderabo on Wednesday 30th of March 2005 10:57:37 AM
Old 03-30-2005
So the total field is numeric rather than packed decimal? I think this should do it:
high5=$(print -n \\0377\\0377\\0377\\0377\\0377)

Define your total field like this:
typeset -Z5 total
to get the leading zeroes you will need.

Remember that ksh will add new line characters unless you supress them:
print -n ${high5}${total}

To test this:
Code:
$ cat x
#! /usr/bin/ksh
high5=$(print -n \\0377\\0377\\0377\\0377\\0377)
typeset -Z5 total
total=123
print -n ${high5}${total} | od -t x1
$  ./x
0000000   ff  ff  ff  ff  ff  30  30  31  32  33
0000012
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Another bash shell to perl conversion

Hello everyone. I am new to linux and need help again. I need help converting this bash shell to linux: for i in `ls -l *.txt` do `./cnvidtf.pl $i` `curl -u login:pswd --disable-espv -T loadfile.seq ftp://11.1.11.1` `mysql -u login -h 11.1.11.1 -ppswd < lddocs.sql` done Thanks! Any help... (6 Replies)
Discussion started by: freak
6 Replies

2. Shell Programming and Scripting

Should I use PERL or Shell scripting?

Hello, I have done some BASIC shell scripting/PERL scripting before so I am familiar with the languages. I am not really sure which one would lend itself better to the application I have to write. I am required to scan the message logs for possible break in attempts. If I use shell scripting... (3 Replies)
Discussion started by: mojoman
3 Replies

3. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

4. Shell Programming and Scripting

Linux/Unix shell scripting vs Perl

Hi, I have general question: i have good working Perl script with .pl extension, and now I have to migrate all to another Linux box, and I was told that I can use only shell scripting, so I'm not sure how different those two things are, will it work without any changes . Is there anything smart I... (6 Replies)
Discussion started by: trento17
6 Replies

5. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

6. Shell Programming and Scripting

Conversion from Perl to Shell scripting

Hai ! I am doing a research on Bioinformatics and a part of the code in perl have to be converted to shell scripting. I am new to shell programming. Pls. kindly help me to convert this code to shell script though it is somewhat lengthy. PLS KINDLY HELP ME. THANKS IN ADVANCE. my @FreeEnergy =... (1 Reply)
Discussion started by: kswapnadevi
1 Replies

7. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

8. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

9. Shell Programming and Scripting

shell or perl script needed for ldif file to text file conversion

This is the ldf file dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com objectClass: sdcsSubscriber objectClass: top postalCode: 29600 sdcsServiceLevel: 10 sdcsCustomerType: 14 givenName: Adelia sdcsBlackListAll: FALSE sdcsOwnerType: T-Mobile sn: Actionteam... (1 Reply)
Discussion started by: LinuxFriend
1 Replies

10. Shell Programming and Scripting

Help required for Oracle database shutdown script conversion from shell to perl

Please tell me how to convert below program from shell script to perl. Same commands need to use in shutdown, just need program help for startup. export ORACLE_BASE=/home/oracle1 lsnrctl start lndb1 sqlplus '/ as sysdba' startup; (2 Replies)
Discussion started by: learnbash
2 Replies
DSTYLE(5)							File Formats Manual							 DSTYLE(5)

NAME
dstyle - format of .dstyle files (display styles) DESCRIPTION
Display styles indicate how to render information on a screen. Each style describes one way of rendering information, for example as a solid area in red or as a dotted outline in purple. Different styles correspond to mask layers, highlights, labels, menus, window borders, and so on. See ``Magic Maintainer's Manual #3: Display Styles, Color Maps, and Glyphs'' for more information on how the styles are used. Dstyle files usually have names of the form x.y.dstylen, where x is a class of technologies, y is a class of displays, and n is a version number (currently 5). The version number may increase in the future if the format of dstyle files changes. For example, the display style file mos.7bit.dstyle5 provides all the rendering information for our nMOS and CMOS technologies for color displays with at least 7 bits of color. Dstyle files are stored in ASCII as a series of lines. Lines beginning with ``#'' are considered to be comments and are ignored. The rest of the lines of the file are divided up into two sections separated by blank lines. There should not be any blank lines within a section. DISPLAY_STYLES SECTION The first section begins with a line display_styles planes where planes is the number of bits of color information per pixel on the screen (between 1 and 8). Each line after that describes one display style and contains eight fields separated by white space: style writeMask color outline fill stipple shortName longName The meanings of the fields are: style The number of this style, in decimal. Styles 1 through 64 are used to display mask layers in the edit cell. The style number(s) to use for each mask layer is (are) specified in the technology file. Styles 65-128 are used for displaying mask layers in non-edit cells. If style x is used for a mask layer in the edit cell, style x+64 is used for the same mask layer in non-edit cells. Styles above 128 are used by the Magic code for various things like menus and highlights. See the file styles.h in Magic for how styles above 128 are used. When redisplaying, the styles are drawn in order starting at 1, so the order of styles may affect what appears on the screen. writeMask This is an octal number specifying which bit-planes are to be modified when this style is rendered. For example, 1 means only information in bit-plane 0 will be affected, and 377 means all eight bit-planes are affected. color An octal number specifying the new values to be written into the bit-planes that are modified. This is used along with writeMask to determine the new value of each pixel that's being modified: newPixel = (oldPixel & ~writeMask) | (color & writeMask) The red, green, and blue intensities displayed for each pixel are not deterimined directly by the value of the pixel; they come from a color map that maps the eight-bit pixel values into red, green, and blue intensities. Color maps are stored in separate files. outline If this field is zero, then no outline is drawn. If the field is non-zero, it specifies that outlines are to be drawn around the rectangular areas rendered in this style, and the octal value gives an eight-bit pattern telling how to draw the outline. For exam- ple, 377 means to draw a solid line, 252 means to draw a dotted line, 360 specifies long dashes, etc. This field only indicates which pixels will be modified: the writeMask and color fields indicate how the pixels are modified. fill This is a text string specifying how the areas drawn in this style should be filled. It must have one of the values solid, stipple, cross, outline, grid. Solid means that every pixel in the area is to modified according to writeMask and color. Stipple means that the area should be stippled: the stipple pattern given by stipple is used to determine which pixels in the area are to be modified. Cross means that an X is drawn in a solid line between the diagonally-opposite corners of the area being rendered. Outline means that the area should not be filled at all; only an outline is drawn (if specified by outline). Grid is a special style used to draw a grid in the line style given by outline. The styles cross and stipple may be supplemented with an outline by giving a non- zero outline field. The outline and grid styles don't make sense without an an outline, and solid doesn't make sense with an out- line (since all the pixels are modified anyway). stipple Used when fill is stipple to specify (in decimal) the stipple number to use. shortName This is a one-character name for this style. These names are used in the specification of glyphs and also in a few places in the Magic source code. Most styles have no short name; use a ``-'' in this field for them. longName A more human-readable name for the style. It's not used at all by Magic. STIPPLES SECTION
The second section of a dstyle file is separated from the first by a blank line. The first line of the second section must be stipples and each additional line specifies one stipple pattern with the syntax number pattern name Number is a decimal number used to name the stipple in the stipple fields of style lines. Number must be no less than 1 and must be no greater than a device-dependent upper limit. Most devices support at least 15 stipple patterns. Pattern consists of eight octal numbers, each from 0-377 and separated by white space. The numbers form an 8-by-8 array of bits indicating which pixels are to be modified when the stipple is used. The name field is just a human- readable description of the stipple; it isn't used by Magic. FILES
~cad/lib/magic/sys/mos.7bit.dstyle5 SEE ALSO
magic(1), cmap(5), glyphs(5) 4th Berkeley Distribution DSTYLE(5)
All times are GMT -4. The time now is 05:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy