10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to divide the number of white spaces by total number of characters in a file using bash. I am able to get the number of white spaces correctly using:
tr -cd < afile | wc -c
I am also able to get the total number of characters using:
wc -c afile
How do I divide the first... (2 Replies)
Discussion started by: ngabrani
2 Replies
2. Shell Programming and Scripting
My original post did not show up properly. I am trying again.
I have a simple tsch script that does some basic arithmetic. The calculated value was not producing the result I was expecting. I wrote a sample script to illustrate the things that I tried.
#!/bin/tcsh
@ count = 43
@... (3 Replies)
Discussion started by: sgualandri
3 Replies
3. Shell Programming and Scripting
I have the following code in a csh script
I want to pass the value of the variable sigmasq to the awk script so that I can divide $0 by the value of sigmasq
grep "Rms Value" $f.log \
| awk '{ sub(/*:*\.*/,x); \
print... (2 Replies)
Discussion started by: kristinu
2 Replies
4. UNIX for Dummies Questions & Answers
Hello all,
I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns.
What I want to do is to to sum the values in each row & column in every file.
The following explains what I want to do;
... (9 Replies)
Discussion started by: Muhammad Rahiz
9 Replies
5. Shell Programming and Scripting
Hi Friends,
please advise on shell script to add two time stamps
for example :
a=12:32
b=12:00
c=a+b=00:32
please help me to find shell script to add to two time stamps, as i need to convert time from EST to GMT or SST to prepare status of jobs in unix and to specify estimated time to... (3 Replies)
Discussion started by: balireddy_77
3 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a list of 'inputs' and i want to convert those on the second list named 'Desired Outputs', but i don't know how to do it?
Inputs Desired Outputs
1 2
94 4
276 8
369 10
464 12 ... (0 Replies)
Discussion started by: filda
0 Replies
7. Shell Programming and Scripting
I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them)
Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies
8. Shell Programming and Scripting
Yes I know tcsh sucks for scripting and arithmetic but I have to write a script for multiple users and they all use tcsh.
I have this variable that I 'set' with but pulling numbers off of stings with
set STUFF = `grep string file | awk command`
Now I would like to add up the numbers that... (4 Replies)
Discussion started by: gobi
4 Replies
9. Shell Programming and Scripting
I am using egrep to extract numbers from a file and storing them as variables in a script. But I am not able to do any arithmetic operations on the variables using "expr" because it stores them as char and not integers. Here is my code and the error I get. Any help will be appreciated.
#!/bin/sh... (3 Replies)
Discussion started by: emjayshaikh
3 Replies
10. UNIX for Dummies Questions & Answers
I am a beginner and I have been searching the web all morning for this answer but can't find it anywhere.
I know that
prtint 1*2
will return
1*2
what if i actually want the problem to be calculated
so i want
print 1*2
to return
2
How is this done? (3 Replies)
Discussion started by: tygun
3 Replies