About the "for" question --
When writing more than a one-liner, give variables clear names. You can see, you've count[] and e[] both using $6. So yes you can combine them.
hi, i would like to extract the header and put it in a variable, then use printf to output the variable, but i keep on getting errors...please tell me if my format is incorrect.
HDR = "`ps -e -o user,pid,ppid,pcpu,stime,etime,time,comm | head -n 1`"
printf (%s, $HDR);
thanks! (3 Replies)
Ih all,
I need to make a ksh script with colors, it is possible with printf to combine column and colors ? i seem not working, I think i dont doing the good thing:
printf -n "%-15s %-20s %-20s\n" "\033
the position is ok
Name______Age________Site
----________---_________----
Bob... (2 Replies)
Hi all,
My simple AWK code does C = A - B
If C can be a negative number, how awk printf formating handles it using string format specifier.
Thanks in advance
Kanu
:confused: (9 Replies)
Hi
I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv.
The sample data that is available in this field is given below
220731.7100000000000000
When i tried using this command
cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}'
I get the output as... (4 Replies)
Hi,
How to format something like this:
John Roberts 324-141-984 Acct
Jack Williams 159-555-555 Acct
William Jackson 949-911-888 Acct
Mark J Walton 145-852-252 Acct
Fred P Milton 483-244-390 Acct
Bill P J Miller 404-050-223 Acct
into... (12 Replies)
Hey, I'm trying to read printf(3) and seems I need to use the * WIDTH
but I'm not quite sure how to go about it.
there needs to be 3 fields per line, the lines read in from file looks like this:
JUICE - APPLE:JUST JUICE:7
MILK - CHOCOLATE:BREAKA:7
this needs to be output backwards with... (6 Replies)
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
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)
Hi
my awk variable $0 contains the below data
Input file
000001 The Data
000002* The line 2
000003* The line3
output file Req
000001* The Data
000002** The line 2
000003** The line3
one * at column seven needs to be appended to the input lines, (5 Replies)
Hello
Here is an easy one
Data file
12345 (tab) Some text (tab) 53.432
23456 (tab) Some longer text (tab) 933.422
34567 (tab) Some different text (tab) 29.309
I need to awk these three tab-delimited columns so that the first two are unchanged (unformatted) and the third shows two decimal... (1 Reply)
Discussion started by: palex
1 Replies
LEARN ABOUT CENTOS
sdl_joystickopen
SDL_JoystickOpen(3) SDL API Reference SDL_JoystickOpen(3)NAME
SDL_JoystickOpen - Opens a joystick for use.
SYNOPSIS
#include "SDL.h"
SDL_Joystick *SDL_JoystickOpen(int index);
DESCRIPTION
Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used.
RETURN VALUE
Returns a SDL_Joystick structure on success. NULL on failure.
EXAMPLES
SDL_Joystick *joy;
// Check for joystick
if(SDL_NumJoysticks()>0){
// Open joystick
joy=SDL_JoystickOpen(0);
if(joy)
{
printf("Opened Joystick 0
");
printf("Name: %s
", SDL_JoystickName(0));
printf("Number of Axes: %d
", SDL_JoystickNumAxes(joy));
printf("Number of Buttons: %d
", SDL_JoystickNumButtons(joy));
printf("Number of Balls: %d
", SDL_JoystickNumBalls(joy));
}
else
printf("Couldn't open Joystick 0
");
// Close if opened
if(SDL_JoystickOpened(0))
SDL_JoystickClose(joy);
}
SEE ALSO
SDL_JoystickClose
SDL Tue 11 Sep 2001, 23:00 SDL_JoystickOpen(3)