Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Wrong Ouput when using printf under SFU Post 302119600 by ilak1008 on Thursday 31st of May 2007 02:12:28 AM
Old 05-31-2007
Quote:
Originally Posted by Ygor
Try reading the man pages for printf. Here's an example...
Code:
a=1
b=2
printf '\nValue of a = %s and value of b = %s\n\n' $a $b

Ygor,

I tried your suggestion as follows:
a=1
b=2
c=3

Printf ‘ M = %s Ohms X = %s Ohms T = %s %%' $a $b $c

The above format worked fine but when a Command Substitution is used to set the Variables, I noticed that it does not give the right output. I did the following:

#value of lrs = 710
lrs=`cat lrs`
#value of hrs = 910
hrs=`cat hrs`
#value of tp = 3
tp=`cat tp`
printf ‘\n\nM = %s Ohms X = %s Ohms T = %s %%\n\n\n' $lrs $hrs $tp

The output is:
%hms T = 310

The desired output should be:
M = 710 Ohms X = 910 Ohms T = 3 %
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Interix/MS Windows SFU

Hey guys, Any chance of getting a thread under 'Special Interest Topics' for Interix/SFU? This has to be one of the most poorly documented pieces of software floating around and it works great for interoperability of windows systems with the rest of your unix/linux network rather than having to... (3 Replies)
Discussion started by: chek
3 Replies

2. Windows & DOS: Issues & Discussions

Changing Directory Using SFU

Just installed SFU in my PC running under Windows XP Pro. Could someone tell us how to change directory and to its subdirectories either by Korn Shell or C Shell? I tried, cd f:\ or chdir f:\ but it didn't work. (1 Reply)
Discussion started by: ilak1008
1 Replies

3. Windows & DOS: Issues & Discussions

FTP using SFU

I'm trying to ftp a file from Solaris to Windows XP Pro using SFU and the command that I used is as follows: ftp -n “host” << cmd user “loginname” “password” cd Directory ls filename error bye cmd If the filename does not exist, it shows the following output: Output to local-file:... (2 Replies)
Discussion started by: ilak1008
2 Replies

4. Shell Programming and Scripting

SFU awk help

hi guys i am trying using this awk command which works perfectly on unix awk '$1>=dt' dt="2007-12-03" filename but when i run same command for same file under SFU it does nothing simply prints the file ( just like cat command ) i am not getting why ? any way i used sed for same ( little... (5 Replies)
Discussion started by: zedex
5 Replies

5. HP-UX

SFU/NFS question

I am new in UNIX so pardon me if I am asking this question. We are using SFU in Windows to have a Windows folder mounted over UNIX. While we can see the mount, everytime i cd on the mounted folder (e.g. cd CONFIG) I always get Permission denies error. Does anyone know why I cannot go inside the... (11 Replies)
Discussion started by: Jolas
11 Replies

6. UNIX for Advanced & Expert Users

How to use ps command on SFU emulator ?

Hi all How can I use ps command on korn shell emulated by SFU on Windows Server ? All others commands work fine, but this one I don't know :confused: Many thanks ---------- Post updated at 11:28 AM ---------- Previous update was at 10:12 AM ---------- Ok, it works fine in fact, I'm... (0 Replies)
Discussion started by: madmat
0 Replies

7. Shell Programming and Scripting

SQL*Plus under SFU

Hi all I have a problem again under Korn Shell with SFU. If I use sqlplus.exe like this : $ sqlplus.exe "/ as sysdba" SQL*Plus: Release 9.2.0.1.0 SQL> select value from v$parameter where name='user_dump_dest'; VALUE -------------------------------------------------------------... (9 Replies)
Discussion started by: madmat
9 Replies

8. HP-UX

SFU and NFS issues

Hi, I support a small lab of older HP UX 9 and 10 boxes. We have some older NT 4.0 machines at each UX box, with a old ZFS Server programs hosting two mounted directories. (Each UX and NT machine is on its own private network via crossover cable). Due to hardware failure/support EOL on NT, I have... (3 Replies)
Discussion started by: the spyder
3 Replies

9. Windows & DOS: Issues & Discussions

Empty folders with SFU

Hi all, i am currently setting my windows XP environment to use with Services for Unix (NFS Client) to mount my unix file system as a network drive. However, though i could mount the unix file directory successful, but the folder is empty (which is not). Why is this so? i have imported my unix... (6 Replies)
Discussion started by: lchunleo
6 Replies

10. UNIX for Beginners Questions & Answers

Tell me about PS command with SFU

Hi all, When I execute ps command with SFU (Microsoft Windows Services for UNIX), the result is returned as an empty line. Other commands will return correct results. How can I get the result of ps command correctly? Thank you. (2 Replies)
Discussion started by: tcx731
2 Replies
create_bmp_for_circ_in_circ(1)				      General Commands Manual				    create_bmp_for_circ_in_circ(1)

NAME
create_bmp_for_circ_in_circ - bitmap generator for circular conductor inside circular conductor (part of atlc) SYNOPSIS
create_bmp_for_circ_in_circ [options... ] D d O Er filename.bmp WARNING
This man page is not a complete set of documentation - the complexity of the atlc project makes man pages not an ideal way to document it, although out of completeness, man pages are produced. The best documentation that was current at the time the version was produced should be found on your hard drive, usually at /usr/local/share/atlc/docs/html-docs/index.html although it might be elsewhere if your system administrator chose to install the package elsewhere. Sometimes, errors are corrected in the documentation and placed at http://atlc.sourceforge.net/ before a new release of atlc is released. Please, if you notice a problem with the documentation - even spelling errors and typos, please let me know. DESCRIPTION
create_bmp_for_circ_in_circ is a pre-processor for atlc, the finite difference program that is used to calculate the properties of a two and three conductor electrical transmission line of arbitrary cross section. The program create_bmp_for_circ_in_circ is used as a fast way of generating bitmaps (there is no need to use a graphics program), for a circular conductor inside a circular conductor (coaxial conduc- tors), like this: ***************** **** **** **** <-----d------> **** *** ***** *** *** *********** *** *** ************* *** *** *************** *** *** ^ *************** *** *** | *************** *** *** | ************* *** ** O *********** ** *** | *** *** ** | ** *<------------------------D------------------------>* ** ** ** ** ** ** *** *** ** ** *** *** ** ** ** ** ** ** *** *** **** **** **** **** ***** ***** ****** ****** ******************* *** The parameter 'D' is the inner dimensions of the outer conductor and 'd' is the outer diameter of the inner conductor. The inner conductor is offset 'h' from the centre of the outer conductor. The whole region is surrounded by a dielectric of relative permittivity 'Er'. The bitmap is printed to 'outfile.bmp' - the last command line argument. The bitmaps produced by create_bmp_for_circ_in_circ are 24-bit bit colour bitmaps, as are required by atlc. The permittivities of the dielectric 'Er' determines the colours in the bitmap. If Er is 1.0, 1.006, 2.1, 2.2, 2.33, 2.5, 3.3, 3.335, 3,7, 4.8, 10.2 or 100, then the colour corresponding to that permittivity will be set according to the colours defined in COLOURS below. If Er is not one of those permittivities, the region of permittivity Er will be set to the colour 0xCAFF00. The program atlc does not know what this permittivity is, so atlc, must be told with the command line option -d, as in example 4 below. OPTIONS
-b bitmapsize is used to set the size of the bitmap, and so the accuracy to which atlc is able to calculate the transmission line's properties. The default value for 'bitmapsize' is normally 4, although this is set at compile time. The value can be set anywhere from 1 to 15, but more than 8 is probably not sensible. -f outfile Set the output filename. By default, the bitmap is sent to stdout, but it *must* be sent to a file, with this option, or as described above. -v Causes create_bmp_for_circ_in_circ to print some data to stderr. Note, nothing extra goes to standard output, as that is expected to be redirected to a bitmap file. COLOURS
The 24-bit bitmaps that atlc expects, have 8 bits assigned to represent the amount of red, 8 for blue and 8 for green. Hence there are 256 levels of red, green and blue, making a total of 256*256*256=16777216 colours. Every one of the possible 16777216 colours can be defined precisely by the stating the exact amount of red, green and blue, as in: red = 255,000,000 or 0xff0000 green = 000,255,000 or 0x00ff00 blue = 000,000,255 or 0x0000ff black = 000,000,000 or 0x000000 white = 255,255,255 or 0xffffff Brown = 255,000,255 or 0xff00ff gray = 142,142,142 or 0x8e8e8e Some colours, such as pink, turquoise, sandy, brown, gray etc may mean slightly different things to different people. This is not so with atlc, as the program expects the colours below to be EXACTLY defined as given. Whether you feel the colour is sandy or yellow is up to you, but if you use it in your bitmap, then it either needs to be a colour reconised by atlc, or you must define it with a command line option (see OPTIONS and example 5 below). The following conductors are reconised by atlc: red = 255,000,000 or 0xff0000 is the live conductor. green = 000,255,000 or 0x00ff00 is the grounded conductor. blue = 000,000,000 or 0x000000 is the negative conductor All bitmaps must have the live (red) and grounded (green) conductor. The blue conductor is not currently supported, but it will be used to indicate a negative conductor, which will be needed if/when the program gets extended to analyse directional couplers. The following dielectrics are reconised by atlc and so are produced by create_bmp_for_circ_in_circ. white 255,255,255 or 0xFFFFFF as Er=1.0 (vacuum) pink 255,202,202 or 0xFFCACA as Er=1.0006 (air) blue 000,000,255 or 0x0000FF as Er=2.1 (PTFE) Mid gray 142,242,142 or 0x8E8E8E as Er=2.2 (duroid 5880) mauve 255.000,255 or 0xFF00FF as Er=2.33 (polyethylene) yellow 255,255,000 or 0xFFFF00 as Er=2.5 (polystyrene) sandy 239,203,027 or 0xEFCC1A as Er=3.3 (PVC) brown 188,127,096 or 0xBC7F60 as Er=3.335 (epoxy resin) Turquoise 026,239,179 or 0x1AEFB3 as Er=4.8 (glass PCB) Dark gray 142,142,142 or ox696969 as Er=6.15 (duroid 6006) L. gray 240,240,240 or 0xDCDCDC as Er=10.2 (duroid 6010) NOTE
Although create_bmp_for_circ_in_circ is used for circular inner and outer conductors, the outside of the outer conductor is drawn as a square. This is for convenience and makes no difference to the calculations. The inside is of the outer conductor is drawn as a circle. EXAMPLES
Here are a few examples of the use of create_bmp_for_circ_in_circ. Again, see the html documentation in atlc-X.Y.Z/docs/html- docs/index.html for more examples. 1) In the first example, the outer conductor has an inside diameter of 12 units (inches, mm, feet etc.), the inner has an outside diameter of 3.9 units. The inner is placed centrally (h=0) and the dielectric is vacuum (Er=1.0). % create_bmp_for_circ_in_circ 12 3.9 0 1.0 coaxial_1.bmp % atlc coaxial_1.bmp atlc will indicate the correct value of impedance to be 67.3667 Ohms, whereas an exact analysis will show the true value to be 67.4358 Ohms, so atlc has an error of 0.102%. 2) In this second example, the conductor sizes are the sames as in example 1, but the inner is located 3.5 units off-centre and the dielec- tric has a relative permittivity of 2.1 (Er of PTFE) The output is sent to a file not_in_centre.bmp which is then processed by atlc % create_bmp_for_circ_in_circ 12 3.9 3.5 2.1 not_in_centre.bmp % atlc not_in_centre.bmp The impedance of this is theoretically 24.315342 Ohms, as create_bmp_for_circ_in_circ will calculate for you. atlc's estimate is 24.2493 Ohms, an error of only -0.271 %. 3) In the third example the bitmap is made larger, to increase accuracy, but otherwise this is identical to the previous one. % create_bmp_for_circ_in_circ -b8 12 3.9 3.5 2.1 bigger_not_in_centre.bmp % atlc bigger_not_in_centre.bmp This time atlc will take much longer to calculate Zo, since the bitmap is larger and so it needs to do more calculations. However, the final result should be more accurate. In this case, the result reported is 24.2461 Ohms, an error that's marginally smaller than before at 0.285 %. It is possible there may be something to be gained by decreasing the cutoff at larger grids, so this is being investigated. How- ever, errors almost always below 0.25 %, no matter what is being analysed. In the fourth example, a material with a relativity permittivity 7.89 of is used. There is no change in how to use cre- ate_bmp_for_circ_in_circ, but since this permittivity is not one of the pre-defined values (see COLOURS), we must tell atlc what it is. The colour will be set an olive green one, with a hexacidcal representation of red=0xCA, blue=OxFF and green = 0x00. This just happens to be the default colour used when the permittivity is unknown. So atlc must be given this information, like thisL % create_bmp_for_circ_in_circ 23 9 0 7.89 an_odd_er.bmp % atlc -d CAFF00=7.89 an_odd_er.bmp This has a theoretical impedance of 20.041970 Ohms, but atlc version 3.0.1 will calculate it to be 20.0300, an error of -0.058 % !!! If you look at the file an_odd_er.bmp with a graphics package, you will see there are 3 colours in it - the red inner conductor, the green outer and an olive-green dielectric. SEE ALSO
atlc(1) create_bmp_for_circ_in_rect(1) create_bmp_for_microstrip_coupler(1) create_bmp_for_rect_cen_in_rect(1) create_bmp_for_rect_cen_in_rect_coupler(1) create_bmp_for_rect_in_circ(1) create_bmp_for_rect_in_rect(1) create_bmp_for_stripline_coupler(1) create_bmp_for_symmetrical_stripline(1) design_coupler(1) find_optimal_dimensions_for_microstrip_coupler(1) readbin(1) http://atlc.sourceforge.net - Home page http://sourceforge.net/projects/atlc - Download area atlc-X.Y.Z/docs/html-docs/index.html - HTML docs atlc-X.Y.Z/docs/qex-december-1996/atlc.pdf - theory paper atlc-X.Y.Z/examples - examples Dr. David Kirkby atlc-4.4.2 10th Sept 2003 create_bmp_for_circ_in_circ(1)
All times are GMT -4. The time now is 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy