hello, Im at another part of the program i am writing. Where i think i'm going to need to use the printf command.
If anyone can help me figure out the printf layout i would greatly appreicate it.
thanks (4 Replies)
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)
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)
Hi,
I a sequance number from 1-999 and i want asing the value like 001,002..999
Exp:
file_001
file_002
file_003...
file_999
How can i disaplay the sequnace number as mention above. (3 Replies)
hallow all i need your advice about this script
i have script like this:
INDEX=/zpool1/NFS/INDEX/${1}
SCRIPT=/zpool1/NFS/script/${1}
LIST=SAMPLE
cd ${SCRIPT}
for i in `cat ${LIST}`
do
GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'`
/usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (4 Replies)
Im a newbie to programming language, i found tat there r these function called printf and putchar() as well as scanf and getchar(), im curious abt why do dey hav these 2 different function although dey r doing the same instruction? :confused: (13 Replies)
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)
Hello,
I have two text files, each with a single column,
file 1:
124152970
123899868
123476854
54258288
123117283
file 2:
124152970
123899868
54258288
123117283
122108330 (5 Replies)
Discussion started by: LMHmedchem
5 Replies
LEARN ABOUT REDHAT
printf
PRINTF(1) FSF PRINTF(1)NAME
printf - format and print data
SYNOPSIS
printf FORMAT [ARGUMENT]...
printf OPTION
DESCRIPTION
NOTE: your shell may have its own version of printf which will supercede the version described here. Please refer to your shell's documen-
tation for details about the options it supports.
Print ARGUMENT(s) according to FORMAT.
--help display this help and exit
--version
output version information and exit
FORMAT controls the output as in C printf. Interpreted sequences are:
" double quote
NNN character with octal value NNN (0 to 3 digits)
\ backslash
a alert (BEL)
backspace
c produce no further output
f form feed
new line
carriage return
horizontal tab
v vertical tab
xNNN byte with hexadecimal value NNN (1 to 3 digits)
uNNNN character with hexadecimal value NNNN (4 digits)
UNNNNNNNN
character with hexadecimal value NNNNNNNN (8 digits)
%% a single %
%b ARGUMENT as a string with `' escapes interpreted
and all C format specifications ending with one of diouxXfeEgGcs, with ARGUMENTs converted to proper type first. Variable widths are han-
dled.
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for printf is maintained as a Texinfo manual. If the info and printf programs are properly installed at your site,
the command
info printf
should give you access to the complete manual.
GNU coreutils 4.5.3 February 2003 PRINTF(1)