Sponsored Content
Full Discussion: Divide by zero script
Top Forums Shell Programming and Scripting Divide by zero script Post 302848221 by rdcwayx on Wednesday 28th of August 2013 08:34:01 PM
Old 08-28-2013
Get non-zero number

Code:
while :
do
  echo "Enter another number."
  read num2
  if [[ $num2 -eq 0 ]]; then
    echo "divide by zero, try again"
  else
    break
  fi
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script needs to divide by 2

i need to divide this count by 2, what variable can i use in my script? 26 hcscprod_cpus_totals /2 = 13 13 hcncprod_cpus_totals /2= 6.5 541 ktazp_cpus_totals /2= 270.5 346 ktazd_cpus_totals /2=173 110 ktazi_cpus_totals /2=55 10 ktazq_cpus_totals /2=5 (2 Replies)
Discussion started by: wereyou
2 Replies

2. Shell Programming and Scripting

divide with awk

Dear, i want to devide the first 4 values from a raw over the next 4 values like the following: $1+$2+$3+$4 / $5+$6+$7+$8 using AWK ....can someone help me? Sanks (1 Reply)
Discussion started by: tontal
1 Replies

3. UNIX for Dummies Questions & Answers

divide issue

Hi, I have a issue dividing 2 values in UNIX a=15 b=100 c = a / b ==> and it is returning 0 instead of 0.15 into variable C. How can i resolve this issue ? please help (1 Reply)
Discussion started by: kotasateesh
1 Replies

4. UNIX for Dummies Questions & Answers

I can't divide properly in shell

I'm new at this and frustratd because I know this must be simple but here goes. I'm trying to write a script that will give me the percentage of a particular field over multiple text files. Each day I have around 1500 files that are generated. Each file has around 100 lines in it. The lines... (3 Replies)
Discussion started by: mikez104
3 Replies

5. Shell Programming and Scripting

Divide variable

Hi All, here D Prints the bytes value .plz help to convert the variable D value to MB in new variable $E D=`more $C |awk '{print $6;}'` Thanks in Advance.:) (3 Replies)
Discussion started by: netdbaind
3 Replies

6. Shell Programming and Scripting

Divide two variable

F= `expr $E/$S` output test5.sh: line 45: 1296863.27001857757568359375/21997: No such file or directory can any one help me ,i just want to divide the $E/$S and Print o/p in F. (3 Replies)
Discussion started by: netdbaind
3 Replies

7. Shell Programming and Scripting

Is it possible to Divide a negative number in bash script

I am using a small script to divide some numbers in a given file and display the output in another file. I am getting the following error basename: invalid option -- '5' Try `basename --help' for more information. (standard_in) 1: syntax error The script is : #!/bin/bash for i in `cat... (4 Replies)
Discussion started by: kmnr877
4 Replies

8. UNIX for Dummies Questions & Answers

To divide file

We have large log files, and we need to extract last four hours lines only, Please let us know the command. Thanks, Saurau. (1 Reply)
Discussion started by: saurau
1 Replies

9. Shell Programming and Scripting

Script to divide/expand first digit to show some numbers

Hello to everyone, I have this complex problem and I don't how to do it. I'm not sure if awk could be a good choice to do it or could be easiest in bash or perl. A kind of introduction would be: - I have a digit, lets say 3. - I can expand/spread out the digit 3 to cover all possible... (7 Replies)
Discussion started by: Ophiuchus
7 Replies

10. Shell Programming and Scripting

Divide the value of the column if not NULL.

File 1 --------- N_ACCT,CARD_TYPE,CARD_BAL,CUST_CODE --------------------------------------------------- 0301,38,0.00,10 0319,38,54422.92,10 0392,38,0.00,10 0418,38,35254.87,10 0442,38,0.00,10 0491,38,0.00,10 0558,38,45988.76,10 0616,38,0.00,10 0665,38,0.00,10 0699,38,0.00,10 File 2... (3 Replies)
Discussion started by: suresh_target
3 Replies
elfdump(1)						      General Commands Manual							elfdump(1)

NAME
elfdump - dump information contained in object files. SYNOPSIS
num] num2] name] section] num] num2] files... DESCRIPTION
takes one or more object files or libraries and dumps information about them. The following options are supported: Dumps archive headers from an archive library. Dumps the string table(s). (Modifier) Demangles C++ symbol names before printing them. This modifier is valid with and If specified with this modifier is ignored. If specified with name, the symbol whose unmangled name matches name will be printed, and its symbol name will be printed as a demangled name. Prints the .note section which contains the compilation unit dictionary and linker footprint. This option has the same effect as Prints the compilation unit dictionary of the .notes section. Prints the linker footprint of the .notes section. The linker footprint has information on the linker used to generate the file as well as the link time. (Modifier) Prints the section whose index is num. (Modifier) Prints the sections in the range 1 to num2. If used with the sections in the range num to num2 are printed. Valid with If used with only the relocations which apply to the section(s) in the range are printed. Dumps the file header (ELF header). Dumps global symbols from an archive. Dumps the section headers. (Modifier) Dumps output information in hexadecimal, octal, or decimal format, with all options. Displays the run-time interpreter path name for (usually the location of the dynamic loader and microloader). Only shared bound executables have this string. To change the setting, use the command. Prints the object dictionary for one or more executable files, if the source file was compiled with the option or linked with (PA-RISC only) option. The object dictionary entry contains the name of the object file that contributed to a particular section, the relative offset within the section, size of the object file's contribution, and attributes of the entry. Prints the CTTI section headers according to the directory member relationship. Dumps the section in shared libraries and dynamically linked program files. Prints the section, which is only created when the incremental linker is used (with the command), or when the linker option is used (which is the default), along with the compiler option, (which is NOT the default). Prints the section, which is only created when the incremental linker is used (with the command), or when the linker option is used (which is the default), along with the compiler option, (which is NOT the default). Prints the section, which is only created when the incremental linker is used (with the command), or when the linker option is used (which is the default), along with the compiler option, (which is NOT the default). (Modifier) Dumps information about the specified section or symbol name. This option is valid with and If used with name pertains to a symbol name and will only dump the symbol entry whose name matches name. If used with the other options, name pertains to a section name and will only dump the section whose name matches it. Dumps the optional headers (program headers). (Modifier) Do not print titles, with all options. (Modifier) Suppresses printing CTTI section headers. Valid with option. Dumps the relocations. Dumps the section contents. Dumps any section beginning with as a string table. (Modifier) Dumps the section specified by name. Valid with and only. (Modifier) Dumps output information in short format. Valid with the and options. Dumps the symbol table entries. (Itanium-based systems) Dumps the value of in symbol table, in addition to information dump from option. This option is useful to verify the data stored in the symbol table. Prints the symbol whose index is num. (Modifier) Prints the symbols in the range 0 to num2. If used with print the symbols in the range num to num2. Valid with Prints versioned symbols. Prints the usage menu. Prints the unwind table. (Modifier) Verifies the CTTI section headers before printing. Valid with the option. Prints the version number for EXAMPLES
To see the functions exported from a shared library: To see the global data items exported from a shared library: To display string table information To list the shared libraries linked with a program or shared library (dependent libraries): To list the embedded path for shared libraries opened by a program: SEE ALSO
System Tools ld(1) Invoke the link editor Miscellaneous a.out(4) Assembler, compiler, and linker output elf(3E) Executable and Linking Format Texts and Tutorials (See the option) (See manuals(5) for ordering information)
All times are GMT -4. The time now is 12:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy