10 More Discussions You Might Find Interesting
1. Programming
Hi,
I haven't programed in C in a few years. I have been doing a lot of shell scripting, I.E. not really programming anything heavy. :o
That said, I have a script that gives hourly usage statistics for our email server. It runs w-a-y to slow as a script for my impatience, and needs to... (7 Replies)
Discussion started by: mph
7 Replies
2. Shell Programming and Scripting
Getting the below error while executing this. Able to run the below commands Individually.
#!/bin/bash
a=$(printf "%d\n" 0x01E);
b=$(printf "%d\n" 0x01A);
echo $a
echo $b
c=`expr $a - $b`
echo $c
syntax error at line 2: `a=$' unexpected (2 Replies)
Discussion started by: sai_1712
2 Replies
3. Shell Programming and Scripting
Hello guys,
I have a problem concerning the formatting when performing calculations with variables passed to awk and using fieldwidth definitions and printf.
I have the following code:
awk 'BEGIN{ FIELDWIDTHS = "5 3 7 5 8 8 8" }{if ($7 != "") printf"%s%-s%s%s%s%s%s\n",$1,$2,$3,$4,$5,$6,$7;... (2 Replies)
Discussion started by: origamisven
2 Replies
4. Shell Programming and Scripting
Hi,
I am using the following code to assign a count value to a variable. But I get nothing. Do you see anything wrong here.
I am new to all this.
$CTR=`remsh $m -l $MACHINES{$m} -n cat $output | grep -v sent | grep \"$input\" | sort -u | awk '{print $5}'`;
Upto sort - u it's... (2 Replies)
Discussion started by: nurani
2 Replies
5. Shell Programming and Scripting
Target file contains short text (never more than 1 line) and filenames.
The format is, e.g.,:
TEXT1
filename1
TEXT2
TEXT3
filename3dddd
filename3dddd
TEXT4
filename4
TEXT5
filename5dddd
filename5dddd
filename5
where dddd is a random 4-digit whole number.
Desired output: (4 Replies)
Discussion started by: uiop44
4 Replies
6. Shell Programming and Scripting
Hi Friends,
Scripting newb here. So I'm trying to create a geektool script that uses awk and printf to output certain fields from top (namely command, cpu%, rsize, pid and time, in that order). After much trial and error, I've pretty much succeeded, with one exception. Any process whose name... (3 Replies)
Discussion started by: thom.mattson
3 Replies
7. Shell Programming and Scripting
echo $bbsize
1.5
echo $fillpercent
.95
echo $bbsize | awk '{printf "%.2f\n",$0*$fillpercent}'
2.25
echo $bbsize | awk '{printf "%.2f\n",$0*.95}'
1.42
1.42 is what I'm expecting...
echo $blocksize
4096
echo $bbsize | awk '{printf "%.2f\n",$0*$blocksize}'
2.25
echo $bbsize |... (3 Replies)
Discussion started by: xgringo
3 Replies
8. Shell Programming and Scripting
Hi friends..
I am confused about awk printf option..
I have a comma separated file
88562848,21-JAN-08,2741079, -1188,-7433,TESTING
88558314,21-JAN-08,2741189, -1273,-7976,TESTING
and there is a line in my script ( written by someone else)
What is the use of command?
I guess... (10 Replies)
Discussion started by: clx
10 Replies
9. Shell Programming and Scripting
See attached file that includes code, input and output.
I am processing a colon delimited input file and building a ":" (colon) delimited output file.
My printf statement prints contents of each of 20 variables and puts them into a record file. I am pushing out approximately 120 records.
The... (2 Replies)
Discussion started by: Skyybugg
2 Replies
10. Shell Programming and Scripting
I am working on a SunFire 480 - uname -a gives:
SunOS bsmdb02 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Fire-480R
I am tyring to sum up the total size of all the directories for each running database using awk:
#!/usr/bin/ksh
for Database in `ps -efl | grep "ora_pmon" | grep -v grep |... (1 Reply)
Discussion started by: jabberwocky
1 Replies