10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a lines like below, captured from rrdtool fetch command,
1395295200 2.0629986254e+06 7.4634784967e+05
1395297000 2.0198121616e+06 6.8658888903e+05
1395298800 1.8787141122e+06 6.7482866452e+05
1395300600 1.7586118678e+06 6.7867977653e+05
1395302400 1.8222762151e+06 7.1301678859e+05I'm... (3 Replies)
Discussion started by: rk4k
3 Replies
2. Programming
Hi,
Struggling with single quotes, double quotes, etc.
I want to print a header line, followed by lines with actual values, based on a print option.
In real life it is going to be something like 15 print options and 50 values.
Output will be 1 header and several value lines.
In this example... (5 Replies)
Discussion started by: ejdv
5 Replies
3. Shell Programming and Scripting
# cat t.txt
2,3,4,5,A,2012-01-01 00:00:28
2,6,4,5,A,2012-01-02 00:00:28
2,7,4,5,A,2012-01-02 02:00:28
# awk -F"," '{OFS=",";print $2,"";printf("%s", strftime("%m%d%y",$6));printf("%s", strftime("%H%M%S \n",$6));print ("",$1)}' t.txt
3,
010170073332
,2
6,
010170073332
,2
7,... (3 Replies)
Discussion started by: before4
3 Replies
4. Shell Programming and Scripting
For example, in this command:
ls /etc/rc0.d/ -print
ls /etc/rc0.d/ -printfThe outputs are quite different, why? (7 Replies)
Discussion started by: Henryyy
7 Replies
5. 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
6. Shell Programming and Scripting
I want to print a string say "str1 str2 str3 str4" using printf.
If I try printing it using printf it is printing as follows.
output
-------
str1
str2
str3
str4
btw I'm working in AIX.
This is my first post in this forum :)
regards,
rakesh (4 Replies)
Discussion started by: enigmatrix
4 Replies
7. 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
8. 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
9. 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
10. Shell Programming and Scripting
Here is the code I'm using
{
printf("%11d %4.2f\% %4.2f\%\n", $1,$2,$3);
}
I want the output to look something like
1235415234 12.24% 52.46%
Instead it looks something like
319203842 42.27\%4.2f\%
How do I just print a "%" without awk or printf thinking I'm trying to do... (1 Reply)
Discussion started by: Awanka
1 Replies