Sponsored Content
Top Forums Shell Programming and Scripting C shell script to convert from inches to meters and centimetres Post 39133 by Ringo on Thursday 7th of August 2003 01:20:30 PM
Old 08-07-2003
C shell script to convert from inches to meters and centimetres

Write a C shell script "in2ftcm" which uses arithmetic expansion to convert from inches to meters and centimetres, rounded down to the nearest whole number of centimetres. Input should be a whole number of inches, and you may assume. Explain your algorithm to determine the inches from the centimetres input.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert shell script for looping

Situation: I have a working shell script on our file server (OSXS Tiger) to connect to a workstation, which is using a portable home directory (phd), and rsync a user's MirrorAgent.log. I'm not that strong of a scripter (obviously), but I would like to add other workstations to this script as they... (4 Replies)
Discussion started by: le0pard13
4 Replies

2. Shell Programming and Scripting

please convert the below program into shell script

if ( ( grep -i "Exception : " /home/dklog* )) then echo " improper combination" elsif ( ( grep -i "invalid" /home/dklog*)) then echo " wrong process " fi fi in the above case i am facing the the syntx error please help in this case... (3 Replies)
Discussion started by: mail2sant
3 Replies

3. Shell Programming and Scripting

having a bash script convert ft to meters with 1 decimal

What is the correct syntax to limit the number of decimals to 1 or 0 in a bash script? Here is the partial code I have which works, but if I echo $meters, it has 4 or 5 decimals: METERS=`echo "$FEET * 0.3048" | bc` I read about scale and length in the bc man page, but I can't seem to get the... (2 Replies)
Discussion started by: audiophile
2 Replies

4. Shell Programming and Scripting

how to convert a shell script to a php script for displaying next word after pattern match

I have a shell script which I made with the help of this forum #!/bin/sh RuleNum=$1 cat bw_rules | sed 's/^.*-x //' | awk -v var=$RuleNum '$1==var {for(i=1;i<=NF;i++) {if($i=="-bwout") print $(i+3),$(i+1)}}' Basically I have a pages after pages of bandwidth rules and the script gives... (0 Replies)
Discussion started by: sb245
0 Replies

5. UNIX for Dummies Questions & Answers

command line util to convert mm to inches etc?

There must be a command line utility to convert metric -> us, mm to inches etc, but I don't remember seeing it. Any suggestions? Anything in the repositories? Thx. (4 Replies)
Discussion started by: koodawg
4 Replies

6. Red Hat

May you convert vbscript to shell script?

Dear! I've a script (vbscript) running on windows machine for along time ago. 2 weeks ago, we changed server from Windows to RHEL5, and this script did not run, and I'm not programmer. So that, I post this script here and wish you convert for me. vbscript code: 'This script will: ' - ZIP... (1 Reply)
Discussion started by: trantuananh24hg
1 Replies

7. Shell Programming and Scripting

convert to shell script

how to convert these code to shell script #include<stdio.h> #include<conio.h> main() { int i,j,a=0,b=0,c=0,f,t,al,ta; int a1, max, n, n1,p,k=0; printf(“\n enter no.of resources”); scanf(“%d”,n1); printf(“\nenter the max no .of resources for each type”); for(i=0;i<n1;i++)... (4 Replies)
Discussion started by: syah
4 Replies

8. Shell Programming and Scripting

Convert shell script to Perl

Hello,,I have a very small script that contains these lines; and it works perfectly; however I need to use Perl now as I will need to feel variables from a MySQL table into this; to it would be nice to start by converting this first... find / -perm 777 \( -type f -o -type d \) -exec ls -lid {}... (1 Reply)
Discussion started by: gvolpini
1 Replies

9. Shell Programming and Scripting

Convert my shell script to C programming HELP!!

I had try to create a basic shell script. So now im trying to convert in to C-programming language can some one guide/help me out with it?(BTW IM USING A LINUX/UNIX/ORACLE SYSTEM) CODE BELOW !/bin/bash for i in `ls -1 /cslab/home/JAZEL/` do cp -uv $i /cslab/home/JAZEL/cs295/$i.`date... (2 Replies)
Discussion started by: Nygenesis
2 Replies

10. UNIX for Beginners Questions & Answers

Shell script to convert rows into cloumns

B010215861628 MA 01020 CARRIER B010215861695 MA 01020 CARRIER B010215861709 MA 01020 CARRIER My output is in the above format I want the output to be: (4 Replies)
Discussion started by: Teegela Prathyu
4 Replies
fax2ps(1)							   User Commands							 fax2ps(1)

NAME
fax2ps - convert a TIFF facsimile to compressed PostScript SYNOPSIS
fax2ps [options] [file] DESCRIPTION
fax2ps reads one or more TIFF facsimile image files and prints a compressed form of PostScript that is suitable for printing on the stan- dard output. OPTIONS
The following options are supported: -H height Use height as the height, in inches, of the output page. The default page height is 11 inches. -p number Print only the indicated page. To print multiple pages, specify this option as often as required. -S Scale each page of image data to fill the output page dimensions. By default, images are presented according to the dimen- sion information recorded in the TIFF file. -W width Use width as the width, in inches, of the output page. The default page width is 8.5 inches. -x resolution Use resolution as the horizontal resolution, in dots per inch, of the image data. By default, this value is taken from the file. -y resolution Use resolution as the vertical resolution, in lines per inch, of the image data. By default, this value is taken from the file. OPERANDS
The following operands are supported: file The name of the TIFF facsimile image file to be converted to compressed PostScript. EXTENDED DESCRIPTION
By default, each page is scaled to reflect the image dimensions and resolutions stored in the file. The -x and -y options can be used to specify the horizontal and vertical image resolutions, respectively. If the -S option is specified, each page is scaled to fill an output page. The default output page is 8.5 by 11 inches. Alternate page dimensions can be specified in inches with the -W and -H options. By default, fax2ps generates PostScript for all pages in the file. You can use the -p option to select one or more pages from a multipage document. fax2ps generates a compressed form of PostScript that is optimized for sending pages of text to a PostScript printer attached to a host through a low-speed link such as a serial line. Each output page is filled with white and then only the black areas are drawn. The Post- Script specification of the black drawing operations is optimized by using a special font that encodes the move-draw operations required to fill the black regions on the page. This compression scheme typically results in a substantially reduced PostScript description, relative to the straightforward imaging of the page with a PostScript image operator. This algorithm can, however, be ineffective for continuous- tone and white-on-black images. For these images, it sometimes is more efficient to send the raster bitmap image directly, see tiff2ps(1). If the destination printer supports PostScript Level II, it is always faster to just send the encoded bitmap generated by the tiff2ps(1) command. Diagnostics Some messages about malformed TIFF images come from the TIFF library. Various messages about badly formatted facsimile images may be generated due to transmission errors in received facsimile. fax2ps attempts to recover from such data errors by resynchronizing decoding at the end of the current scanline. This can result in long horizontal black lines in the resultant PostScript image. EXAMPLES
Example 1: Converting the Tiff File test.tif to Compressed PostScript example% fax2ps test.tif ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWTiff | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
tiff2ps(1), libtiff(3) NOTES
Updated by Breda McColgan, Sun Microsystems Inc., 2004. SunOS 5.10 26 Mar 2004 fax2ps(1)
All times are GMT -4. The time now is 10:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy