Sponsored Content
Top Forums Shell Programming and Scripting bc: scope doesn't work for me Post 302463638 by LostInTheWoods on Monday 18th of October 2010 06:26:44 AM
Old 10-18-2010
bc: scope doesn't work for me

I am trying to use bc to calculate the difference between two nano second time stamps. bc does the calculation but seems to ignore the scale option:

Code:
micro_start=$(date +%s.%N)

# .. some stuff happens here

micro_stop=$(date +%s.%N)

TOT=$(echo "scale=3; $micro_stop - $micro_start" | bc)

echo $micro_start
echo $micro_stop
echo $TOT

This gives:
Code:
1287396929.888596184
1287396930.278798126
.400802946

I cannot figure out what I am dong wrong here.. why is bc ignoring the scale option?

Many Thanks,
Stephen
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies

2. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

3. UNIX for Dummies Questions & Answers

FTP doesn't work

Hi! I have 2 servers. The firts has vsftpd server with this configuration: # Example config file /etc/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all... (2 Replies)
Discussion started by: Torquemada
2 Replies

4. Shell Programming and Scripting

alias doesn't work

Hi I have put alias ll='ls -la' in .profile file but it doesn't work. On hand it works it looks like the .profile file is not beeing read. How to check whitch file is loaded? ,profile? .bash_profile? My system: SunOS mion 5.10 Generic Shell: /bin/pfksh Thanks (2 Replies)
Discussion started by: miojamo
2 Replies

5. UNIX for Advanced & Expert Users

remsh doesn't work

Hi, I need to use remsh inside a ksh script. The script would remsh to another machine (maybe different OS) and then execute commands. A Simple Script: #!/usr/bin/ksh remsh sun7656 -l myuser "cd /user.3/MyFolder; ls -lart" But this gives me the error: permission denied I also... (4 Replies)
Discussion started by: som.nitk
4 Replies

6. Shell Programming and Scripting

Help with script.. it Just doesn't work

Hello,, Im verry new to scripting and have some problems with this script i made.. What it does: It checks a directory for a new directory and then issues a couple of commands. checks sfv - not doing right now checks rar - it checks if theres a rar file and when there is it skips to... (1 Reply)
Discussion started by: atmosroll
1 Replies

7. Shell Programming and Scripting

HELP: If Doesn't Work in AWK

Hi! I have a somehow big file (almost 3000 lines long and thirteen columns). Some lines have no value at all or, at least, are incomplete. The columns' values that have no data are marked with a "-" and the corresponding line (the line that owns that value) should be discarded and not used. ... (5 Replies)
Discussion started by: Marcelo de Brit
5 Replies

8. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

9. HP-UX

Sudo doesn't work

I edited sudoers like this:vi /etc/sudoers subex ALL =(root) NOPASSWD: /usr/ccs/bin/pstack But the respective user still is prompted for password, and even when the right password is used, the command is still not launched.$sudo usr/ccs/bin/pstack 26557 We trust you have received the usual... (5 Replies)
Discussion started by: black_fender
5 Replies

10. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
update-fonts-scale(8)					      System Manager's Manual					     update-fonts-scale(8)

NAME
       update-fonts-scale - generate fonts.scale files

SYNOPSIS
       update-fonts-scale [OPTION] directory ...

DESCRIPTION
       update-fonts-scale  assembles  a  fonts.scale  file  in	an  X  font  directory	using  one  or more scale files found in a subdirectory of
       /etc/X11/fonts/.  It is typically invoked only from the post-installation and post-removal scripts of a package containing  scalable  fonts
       usable  by  the	X Window System whose X LFD font names are not in the font files themselves, but may be invoked at any time to reconstruct
       fonts.scale files.  For each directory, which is either an absolute path to an X font directory or (preferably) simply the  last  component
       of   its   path	(such  as  '75dpi'  or	'misc'),  update-fonts-scale  will  assemble  either  /usr/lib/X11/fonts/directory/fonts.scale	or
       /usr/share/fonts/X11/directory/fonts.scale from the index files found at /etc/X11/fonts/directory/package.scale, where package is the  name
       of the package installing the fonts.

       This enables multiple packages to provide names for fonts in the same directory.  No font package actually provides the fonts.scale file in
       the X font directory itself, so there is no danger of overwriting one package's font names with those of another.

       For instance, the two packages 'xfonts-scalable' (real) and 'xfonts-nifty'  (hypothetical)  may	both  install  fonts  into  the  directory
       /usr/lib/X11/fonts/Type1.     They    each    place    their    fonts.scale   files   in   /etc/X11/fonts/Type1/xfonts-scalable.scale   and
       /etc/X11/fonts/Type1/xfonts-nifty.scale (respectively).	update-fonts-scale concatenates these two files (as well as any others that  match
       /etc/X11/fonts/Type1/*.scale) into /usr/lib/X11/fonts/Type1/fonts.scale.

       The format for fonts.scale files is given in the mkfontdir(1x) manual page.

       An example of how to use update-fonts-scale in package maintainer scripts is provided in the Debian Policy Manual.

OPTIONS
       -h, --help displays a brief usage message and exits.

OPERANDS
       update-fonts-scale takes one or more X font directory names to operate on as operands.  Only the final path component of the directory name
       should be specified; e.g.,
	      update-fonts-scale 75dpi
       is correct, while 'update-fonts-scale /usr/X11R6/lib/X11/fonts/75dpi' and 'update-fonts-scale /usr/lib/X11/fonts/75dpi' are not.

ENVIRONMENT
       COLUMNS
	      indicates the width of the terminal device in character cells.  This value is used for formatting diagnostic messages.  If not  set,
	      the terminal is queried using stty(1) to determine its width.  If that fails, a value of '80' is assumed.

       DEBUG  determines  whether low-level diagnostic messages are issued to standard error output.  A null (empty) or unset value indicates that
	      they are not, and a non-null value indicates that they are.

DIAGNOSTICS
   Errors
       usage error: one or more font directories must be provided
	      update-fonts-scale was invoked without operands.	Supply one or more X font directory names to operate on.

       usage error: unrecognized option
	      update-fonts-scale was invoked with an unrecognized option argument.  Use only the options documented in "OPTIONS", above.

       fatal error: path to X font directory must be used
	      A directory name was supplied that was not an X font directory name.  Supply X font directory names only.

   Warnings
       warning: absolute path directory was provided
	      Usage of absolute paths is deprecated.  Use only the final component of the X font directory name for directory.

       warning: directory does not exist or is not a directory
	      The supplied directory was invalid.  update-fonts-scale skipped it.

   Notes
       Notes are only displayed under special circumstances; see "ENVIRONMENT".  above.

       note: index references nonexistent font file filename
	      The index file /etc/X11/fonts/directory/package.scale, refers to a nonexistent font file, filename.  This is normal when package has
	      been removed, but not purged from the system.  In other circumstances, it likely indicates an error in package.

EXIT STATUS
       0      update-fonts-scale ran successfully.

       1      update-fonts-scale experienced a fatal error; see the section on diagnostic messages above.

       2      update-fonts-scale was invoked with invalid arguments.

BUGS
       See  the  Debian  Bug Tracking System <http://bugs.debian.org/xfonts-utils>.  If you wish to report a bug in update-fonts-scale, please see
       /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.

AUTHOR
       update-fonts-scale was written by Branden Robinson.

SEE ALSO
       mkfontdir(1x)

Debian Project							    2004-11-12						     update-fonts-scale(8)
All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy