03-21-2005
here is a simple way to do it,
sed 's/M$//' filename | awk '{x += $0} END {print "total: " x "M"}'
Last edited by tanku; 03-21-2005 at 09:51 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
HI
I want to round off an integer to the next multiple of 10 in shell script.
(i.e.,) 91 should be rounded off to 100
and 90 should be rounded off to 90
It would be very helpful, if you can help me in this.
Thanks in advance (4 Replies)
Discussion started by: dayamatrix
4 Replies
2. Shell Programming and Scripting
Hello, I am creating a script that gives me system load info when i start a shell or log in via ssh(in the /etc/profile.d/ folder).
I created it successfully for bash and want it to work with c-shell as well.
This is where i'm having problems, the integer test in the if sentence does not work... (3 Replies)
Discussion started by: str1fe
3 Replies
3. Shell Programming and Scripting
Folks
Appreciate your help in understanding issue in relation to below.
I need to pul uvalue from a file (tmpfile) and compare it with a number to make decision.
Using #!/bin/sh
contents of tmpfile :
Slot uvalue : 0.16
How I am pulling it:
unifval=`awk '/uvalue/ {print $4}' tmpfile` ... (1 Reply)
Discussion started by: wndgs
1 Replies
4. Shell Programming and Scripting
Hi fellows!!
i'm doing something which is not working out for me properly which i don't understand why
nowdate=`date +%s`
echo $nowdate
now the problem how to convert a date which is stored in a variable
mydate="22/Oct/2011"
mydate=`date -d '$mydate' +%s`
it gives error... (11 Replies)
Discussion started by: me_newbie
11 Replies
5. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
6. Shell Programming and Scripting
Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered.
The script is as follow:
#!/bin/sh
for file in file_1.txt file_2.txt file_3.txt
do
awk '{ print "0" }' $file > tmp.tmp
mv tmp.tmp $file
done
And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies
7. Red Hat
Hi Team
we have created a DNS server at RHEL6.2 environment in 10.20.203.x/24 network.
Everything is going well on linux client as nslookup, ping by host etc in entire subnet. We are getting problem in windows client as nslookup working as well but not ping. all the firewall is disabled and... (5 Replies)
Discussion started by: boby.kumar
5 Replies
8. Shell Programming and Scripting
I am trying to automate a script where I need to use pbrun /bin/su but for some reason it is not passing thru the pbrun as my code below.
. ~/.bash_profile
pbrun /bin/su - content
c h 1
hpsvn up file path
I am executing this from an external .sh file that is pointing to this scripts file... (14 Replies)
Discussion started by: jorgejac
14 Replies
9. Shell Programming and Scripting
Hello, Newbie here,
I have a perfectly well working web service call I can issue from chrome (PC Windows 10) and get the results I want (a dimmer being turned on in Fibaro Home Center 2 at level 40)
I am not allowed to post urls but the below works with http and :// and... (3 Replies)
Discussion started by: abigbear
3 Replies
10. Shell Programming and Scripting
Hi Team,
I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system.
df -h | awk -v host=`hostname` '
BEGIN {
print "<table border="4"... (13 Replies)
Discussion started by: Harihsun
13 Replies
END(7) PostgreSQL 9.2.7 Documentation END(7)
NAME
END - commit the current transaction
SYNOPSIS
END [ WORK | TRANSACTION ]
DESCRIPTION
END commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a
crash occurs. This command is a PostgreSQL extension that is equivalent to COMMIT(7).
PARAMETERS
WORK, TRANSACTION
Optional key words. They have no effect.
NOTES
Use ROLLBACK(7) to abort a transaction.
Issuing END when not inside a transaction does no harm, but it will provoke a warning message.
EXAMPLES
To commit the current transaction and make all changes permanent:
END;
COMPATIBILITY
END is a PostgreSQL extension that provides functionality equivalent to COMMIT(7), which is specified in the SQL standard.
SEE ALSO
BEGIN(7), COMMIT(7), ROLLBACK(7)
PostgreSQL 9.2.7 2014-02-17 END(7)