08-10-2010
thanks Jim very handy this sprintf. Thanks!!!
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there!
I'm trying to write a script that will capture output from a command and assign it to a variable.
Let's say, for example, I'd like to catch from inside the script whatever the following command outputs:
ls *.aaa
and put it into a variable "listoffiles".
What I tried was:
set... (3 Replies)
Discussion started by: machinogodzilla
3 Replies
2. UNIX for Advanced & Expert Users
#include <stdio.h>
#include <math.h>
// this function calculates the volume of a Cylinder
int main(void)
{
int r; // radius
int h; // height
double M_PI; // pi
int pOne = pow (r, 2);
// get user input of radius and height
printf ("Enter your... (3 Replies)
Discussion started by: pwanda
3 Replies
3. Shell Programming and Scripting
printf "%X\n" "A"
41
printf "%X\n" "2"
2
Expected 32 (not 2).
Is there a "printf" which will output the hexadecimal value of a numeric character? (9 Replies)
Discussion started by: methyl
9 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
I have the below script and output.
cat test.sh
#!/bin/bash -x
logit()
{
echo " - ${*}" > ${LOG_FILE}
}
LOG_FILE=/home/infrmtca/bin/findtest.log
VAR=`find . -type f -name "*sql"`
logit $VAR
Output:
cat /home/infrmtca/bin/findtest.log
-... (9 Replies)
Discussion started by: Ariean
9 Replies
5. Shell Programming and Scripting
Hi All;
I try to create a excel like table with headers and some fields containing values, other long and complex mathematic formulas.
I have some header like : Name Formula Value True/False
Under name column, they are some formula names, formula column some long mathematic formulas... (9 Replies)
Discussion started by: reseki
9 Replies
6. Shell Programming and Scripting
How to capture system() function output in awk variable and the print that awk variable..... (8 Replies)
Discussion started by: bharat1211
8 Replies
7. UNIX for Beginners Questions & Answers
So I created two shell variables: COLUMN1_HEADING, COLUMN2_HEADING.
They have values:
COLUMN1_HEADING="John"
COLUMN2_HEADING="123456789"
How would I use printf to get it to print an output like this: $COLUMN1_HEADING\t$COLUMN2_HEADING\nJohn\t123456789\n
Thanks! (3 Replies)
Discussion started by: steezuschrist96
3 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
2. Relevant commands, code, scripts, algorithms:
#! /bin/ksh
v="ORG_ID"
... (2 Replies)
Discussion started by: sujitdas2104
2 Replies
LEARN ABOUT OPENDARWIN
curs_printw
curs_printw(3X) curs_printw(3X)
NAME
printw, wprintw, mvprintw, mvwprintw, vwprintw, vw_printw - print formatted output in curses windows
SYNOPSIS
#include <curses.h>
int printw(char *fmt [, arg] ...);
int wprintw(WINDOW *win, char *fmt [, arg] ...);
int mvprintw(int y, int x, char *fmt [, arg] ...);
int mvwprintw(WINDOW *win, int y, int x,
char *fmt [, arg] ...);
#include <varargs.h>
int vwprintw(WINDOW *win, char *fmt, varglist);
int vw_printw(WINDOW *win, char *fmt, varglist);
DESCRIPTION
The printw, wprintw, mvprintw and mvwprintw routines are analogous to printf [see printf(3S)]. In effect, the string that would be output
by printf is output instead as though waddstr were used on the given window.
The vwprintw routine is analogous to vprintf [see printf(3S)] and performs a wprintw using a variable argument list. The third argument is
a va_list, a pointer to a list of arguments, as defined in <varargs.h>.
RETURN VALUE
Routines that return an integer return ERR upon failure and OK (SVr4 only specifies "an integer value other than ERR") upon successful com-
pletion.
PORTABILITY
The XSI Curses standard, Issue 4 describes these functions. The function vwprintw is marked TO BE WITHDRAWN, and is to be replaced by a
function vw_printw using the <stdarg.h> interface.
SEE ALSO
curses(3X), printf(3S), vprintf(3S)
curs_printw(3X)