04-23-2008
Problem in arithemetic operation
Hi All,
I am facing a problem while doing arithemetic operation
My code pasted below.
COUNT_BREAKTIME=`expr ($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER`
error is ./OFR_Break_Avgtime.sh: command substitution: line 30: syntax error near unexpected token `$COUNT_TOTALTIME1'
./OFR_Break_Avgtime.sh: command substitution: line 30: `expr ($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER'
can any one help me
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Fellows I ran in to a problem this morning and could not figure out a solution to it.
I have a file like
OBJECT="ABC" GFT="JHU"
DESCRIPTION="ABC MNCL JHDG "
OBJECT="ABC" GFT="JHU"
DESCRIPTION="ABC MNCL JHDG "
OBJECT="ABC" GFT="JHU"
DESCRIPTION="ABC MNCL JHDG "
DESCRIPTION="ABC MNCL JHDG "... (2 Replies)
Discussion started by: ajnabi
2 Replies
2. UNIX for Dummies Questions & Answers
I am using a script which does a lot of math and I am facing a problem.One value is greater than 10 mi and the script converts it to exponents i.e 70000000 7e...
and this is causing my statements to become invalid.
This is what I used
A=`expr "${total}-${FAC}"|bc`
where $total and $FAC are... (9 Replies)
Discussion started by: anujairaj
9 Replies
3. Shell Programming and Scripting
Hi all,
Here is my situation.
I have a text file TXT_FILE like this:
john 123456
jack 94589
kelvin 94595
mary 88585
I want to read the first word in each line ( the name ) and assign to a string variable ( EX_LIST ) in my script so that I can use later as this commandfor i in... (6 Replies)
Discussion started by: fongthai
6 Replies
4. Shell Programming and Scripting
I'm trying to get awk to do arithmetic functions with external variables and I'm getting an error that I cannot figure out how to fix.
Insight would be appreciated
money=$1
rate1=$(awk -F"\t " '/'$converting'/{print $3}' convert.table)
rate2=$(awk -F"\t"... (2 Replies)
Discussion started by: DKNUCKLES
2 Replies
5. Shell Programming and Scripting
Hi, I would like ask for you help for coding array operation.
array= ( a b c d e f )
I would like to remove entry "d" from my array and import the remaining entries back to the array.
Thanks. (3 Replies)
Discussion started by: phamp008
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
Can anyone explain me what is the functionality of this code
cat << EOF > $TSTFILE
/$1/ { print "SENT" }
EOF
Suggestions welcome
Thanks in advance (0 Replies)
Discussion started by: trichyselva
0 Replies
7. UNIX for Dummies Questions & Answers
I am trying to ask for full name in a script, Then echo back to the user with the surname only, omitting the first name.
Thanks (2 Replies)
Discussion started by: orjnet
2 Replies
8. Shell Programming and Scripting
/home8/mc09ats/UnixCw/file4
this is the path...i have 2 variables filename and filepath...i want
filename=file4
filepath=/home8/mc09ats/UnixCw
i.e. i think i have to find last occurence of "/" in string and the string after "/" want to take in some variable and string before last "/"... (4 Replies)
Discussion started by: AbhijitIT
4 Replies
9. Shell Programming and Scripting
I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file .
file.txt
900.00000 1 1 1
500.00000
500.00000
100000.000
4
4
1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies
10. UNIX for Dummies Questions & Answers
dear all,
I need to get files from ftp when only files consist of words 'EUROPE'
ftp sources in folder /ftp1/ftp2/ftp3/201409
files inside /ftp1/ftp2/ftp3/201409is as below
201409_EUROPE_citizen.txt
201409_EUROPE_natality.txt
201409_EUROPE_occupancy.txt
201409_ASIA_citizen.txt... (1 Reply)
Discussion started by: radius
1 Replies
LEARN ABOUT DEBIAN
cow-shell
cow-shell(1) cowdancer cow-shell(1)
NAME
cow-shell - Start a copy-on-write session and invoke a shell.
SYNOPSIS
cow-shell [commandline]
DESCRIPTION
cow-shell Executes specified command with cowdancer or a shell if no command-line option is given.
Inside the cowdancer session, files under the current directory are protected in a way so that a write operation to an i-node which existed
at the point of running cow-shell is not modified.
Useful for managing hard-linked source-trees and scratch-filesystems.
EXAMPLES
cp -al cowdancer/ cowdancer.new && cd cowdancer.new && cow-shell
Create a hardlinked tree, and cd into the newly created tree. After invoking cow-shell inside that tree, a write operation against
a file that is hardlinked with the original tree will be copied to a new file before write.
cp -al cowdancer/ cowdancer.new && cd cowdancer.new && cow-shell debuild
Tries to run dpkg-buildpackage on the new tree, to avoid damage to the original tree.
Configure debuild to ignore .ilist files, through -i or -I option.
FILES
.ilist Generated dynamically in the current directory. The file contains the list of i-node numbers that should be protected from write
operation.
/usr/lib/cowdancer/libcowdancer.so
The shared library used internally that overrides some functions that potentially write to files. This library implements the COW
feature and is preloaded with LD_PRELOAD.
/bin/cp
Used for copying. Requires GNU option -a to be functional.
ENVIRONMENT
COWDANCER_ILISTFILE
The path to the current .ilist file.
COWDANCER_IGNORE
Used internally to work around infinite loops. It will be unset.
LD_PRELOAD
Utilized to preload libcowdancer.so
COWDANCER_DEBUG
Debugging option. Enables debug messages. cowdancer will give verbose debug messages in standard error output.
COWDANCER_SO
Debugging option. Specifies a different path for libcowdancer.so.
COWDANCER_REUSE=yes
Enables reuse of cowdancer .ilist file found for consecutive runs of cow-shell.
RETURN VALUE
The functions that are overridden with cowdancer will give an errno value of ENOMEM when there is a problem.
System isn't really out of memory, but this error code is chosen because this error is usually handled gracefully by applications.
RESTRICTIONS
Can only support directories that are scanned by cow-shell command.
The operation is not semantically correct when files are originally hardlinked, hardlinks are always broken.
Does not support anything when LD_PRELOAD trick does not work.
Does not work unless hardlinks are supported on the filesystem.
Not very user-friendly.
Leaves .ilist file around.
AUTHOR
Junichi Uekawa (dancer@debian.org)
Upstream page is available at http://www.netfort.gr.jp/~dancer/software/cowdancer.html
SEE ALSO
cowdancer-ilistcreate (1)
cowdancer 2006 Jan 25 cow-shell(1)