Sponsored Content
Top Forums UNIX for Dummies Questions & Answers I can't divide properly in shell Post 302170784 by joeyg on Tuesday 26th of February 2008 04:09:08 PM
Old 02-26-2008
Tools Not exactly sure of all your variables

Perhaps this example will help you:

Code:
> cat divide
#! /bin/bash

failed=21
played=48

ans=$(($failed * 100 / $played))
echo $failed" / "$played" ="
echo $ans"%"

Quote:
> divide
21 / 48 =
43%
 

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

Shell script not processing if statement properly

Hi I am trying to create a shell script that will look for a contracthead file first and if the contract head file does not exist on day1 exit script. Now on day2 if contracthead exists or not run the script uploading files in order such as contract line then contract contact so the... (2 Replies)
Discussion started by: jonathan184
2 Replies

3. Shell Programming and Scripting

Output in my shell isn't showing properly.

Hi! Can anyone tell me what went wrong in my shell script? for dt_val in `cut -f 1 -d '|' /prod/ods/satyaki/sqlldr/grp.dat` do echo $dt_val done And, the output is - 23 39 (7 Replies)
Discussion started by: satyakide
7 Replies

4. UNIX for Dummies Questions & Answers

Issue with shell script: not detecting file properly

The following script is meant to check the presence of a file - called filename0.94.tar.gz - and uncompress it: #!/bin/sh # check presence of file VERSION=0.94 if ; then # file not present: abort echo "Files cannot be found." #exit 1 (commented out this line, so we can see how the... (2 Replies)
Discussion started by: figaro
2 Replies

5. Shell Programming and Scripting

Shell Script Email not working Properly

Hi GURU's, I'm using a Shell Script to send email's as an attachment. I'm Storing the email address in a table and catching in a variable. MAILLIST=`noarg sqlplus -s $OraUsr << EOF set heading off set feedback off set echo off SELECT email_ids FROM tpemail_table WHERE... (9 Replies)
Discussion started by: karthikraj
9 Replies

6. Shell Programming and Scripting

Shell script not working properly

Hello, i have below shell script to process ftp get from server and create file list afte finish. this shell scipt has 6 parameter input. unfortunately, it is only working to get the file and terminated before creating file list. please help. thanks, #!/bin/ksh ## example usage :... (3 Replies)
Discussion started by: daryatmo
3 Replies

7. Shell Programming and Scripting

Can't get shell parameters to pass properly to sqlplus

Gurus, The issue I'm having is that my Shell won't accept SQL parameters properly...... Here's they way I'm running it.... applmgr@ga006hds => sh CW_MigrationDeployScript.sh apps <appspwd> <SID> '01-JAN' '31-MAR' The process just hangs not submitting the SQL job... ... (3 Replies)
Discussion started by: WhoDatWhoDer
3 Replies

8. 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

9. Shell Programming and Scripting

Divide by zero script

Hi, I've been working on a few scripts and have been getting great info. How, would I include in the below script, how I would let a user know that if they divide a SECOND number by zero, that they would get a divide by zero error? What's the easiest way of working this? Cordially, joe. ... (1 Reply)
Discussion started by: jefferj54
1 Replies

10. 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
XMMS2-ET(1)						      General Commands Manual						       XMMS2-ET(1)

NAME
xmms2-et - transmits an anonymous informative packet to the XMMS2 team on each song change SYNOPSIS
xmms2-et DESCRIPTION
XMMS2 is a redesign of the XMMS (http://www.xmms.org) music player. It features a client-server model, allowing multiple (even simultane- ous!) user interfaces, both textual and graphical. All common audio formats are supported using plugins. On top of this, there is a flexi- ble media library to organize your music. xmms2-et is the ET Phone Home Client for XMMS2. xmms2-et is designed to transmit a packet of information to the XMMS2 team whenever a new song is played. The packet is anonymous and does not contain metadata about the song being played. The specifics of what data is transmit- ted to the XMMS2 team can be found in the ET PACKET section of this manual page. xmms2-et is used for release engineering by the XMMS2 team. During a release cycle, the usage of various plugins, operating systems, and XMMS2 components is collected from data transmitted by the xmms2-et client. A release is made when sufficient testing has occured as deter- mined by the number of related xmms2-et packets that the XMMS2 team has received. ET PACKET
The following data is transmitted with every packet transmitted by xmms2-et: XMMS2-ET status Begins XMMS2-ET packets; status gives a descriptive message denoting what this packet is about. (e.g. Clean shutdown, Unclean shut- down, New media) version=version contains the version of the XMMS2 daemon system=os contains the name and release of the operating system on which xmms2d is running output=output_plugin contains the output plugin being used to playback audio by xmms2d starttime=start_time contains the time at which the xmms2-et client was started uptime=xmms2d_uptime contains the uptime of the xmms2-et client playlistloads=times contains the number of times a playlist has been loaded from the Media Library mlibresolves=times contains the number of times that metadata has been resolved for media in the Media Library The following data is different for each song being played: decoder=plugin contains the decoder plugin used to playback the last played song transport=plugin contains the transport plugin used to read the last played song samplefmt:in=in_fmt contains the sample format of the original audio file of the last played song samplefmt:out=out_fmt contains the sample format that was sent to the output plugin for the last played song samplerate:in=in_rate contains the sample rate of the original audio file of the last played song samplerate:out=out_rate contains the sample rate that was sent to the output plugin for the last played song channels:in=number_in contains the number of channels of the original audio file of the last played song channels:out=number_out contains the number of channels that were sent to the output plugin for the last played song ENVIRONMENTAL VARIABLES
XMMS_PATH The URL path to xmms2d. See IPC SOCKET in xmms2d(8) for details of possible values for this variable SEE ALSO
xmms2(1), xmms2d(8), http://xmms2.xmms.org HISTORY
The XMMS2 Project was started by Tobias Rundstrom and Anders Gustafsson. It is developed with their lead by a small group of contributers from all over the world. AUTHOR
This manual page was written by Alexander Botero-Lowry <alex@foxybanana.com> XMMS2-ET(1)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy