Sponsored Content
Full Discussion: Printf statement
Top Forums Shell Programming and Scripting Printf statement Post 302501057 by jim mcnamara on Wednesday 2nd of March 2011 10:44:19 AM
Old 03-02-2011
When printf encounters a character that is not [:digit:] or a dot or a - you get that error. Nothing else does that. The data is the problem, not necessarily the code.

It can be an unprintable character. try
Code:
echo $4 | od

And you are positive that the 000 characters are not character O rather than numeric 0
 

10 More Discussions You Might Find Interesting

1. Programming

printf

What is the output of the following program considering an x86 based parameter passing sequence where stack grows towards lower memory addresses and that arguments are evaluated from right to left: int i=10; int f1() { static int i = 15; printf("f1:%d ", i); return i--; } main() {... (2 Replies)
Discussion started by: arunviswanath
2 Replies

2. Shell Programming and Scripting

printf

How to print output in following format? A..................ok AA................ok AAA..............ok AAAAAA........ok "ok" one under one (4 Replies)
Discussion started by: mirusnet
4 Replies

3. Shell Programming and Scripting

If statement - How to write a null statement

In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands. How do I write the "do nothing" statement in the following example? Example: if (( "$x"="1" && "$y"="a" && "$z"="happy" )) then do nothing else command command fi... (3 Replies)
Discussion started by: april
3 Replies

4. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

5. UNIX for Dummies Questions & Answers

Need help with printf

Hi, I have just completed my first script (:D) and now i just need to format it with printf. This is what I have: #!/bin/ksh TOTB=0 TOTF=0 TOTI=0 HOST=`hostname` echo " FSYSTEM BLKS FREE INUSE MOUNTEDON" df -m | grep -v ":"|grep -v Free|grep -v "/proc"| while read FSYSTEM... (2 Replies)
Discussion started by: compan023
2 Replies

6. UNIX for Dummies Questions & Answers

printf function

#include<stdio.h> int counter; int fibonacci(int n) { counter += 1; if ( n <= 2 ) return 1; else return fibonacci(n-1) + fibonacci(n-2); } int main(void) { int i; int sum ; for( i = 1 ; i<= 10; i++) { counter = 0; sum... (1 Reply)
Discussion started by: vincent__tse
1 Replies

7. Shell Programming and Scripting

creating printf statement using user arguments

I am writing a script in bash and want to perform the operation I check number of arguments and make a print statement with the passes arguments If I pass 3 arguments I will do printf "$frmt" "$1" "$2" "$3"If I have 4 arguments I do printf "$frmt" "$1" "$2" "$3" "$4"etc (4 Replies)
Discussion started by: kristinu
4 Replies

8. Shell Programming and Scripting

How to add printf statement in awk command?

hi all i need to add the prinf statement in awk command for the converted comma separated output.... below is my code : Code Credits :RudiC awk -F, 'NF==2 {next} {ITM=$1 AMT=$2+0 CNT=$3+0 TOTA+=$2 ... (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

9. Shell Programming and Scripting

Printf statement for currency conversion

hi all, I had my script as a=qw b=rter c=fdfd curency=1000 printf"${curency} $a $b $c" > filename can i have printf statement that can change the currency from 1000 to 1,000 like it should convert the number to currency format ..?(i.e for any number) (14 Replies)
Discussion started by: hemanthsaikumar
14 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
iswalpha(3C)						   Standard C Library Functions 					      iswalpha(3C)

NAME
iswalpha, isenglish, isideogram, isnumber, isphonogram, isspecial, iswalnum, iswascii, iswblank, iswcntrl, iswdigit, iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit - wide-character code classification functions SYNOPSIS
#include <wchar.h> #include <wctype.h> int iswalpha(wint_t wc); int isenglish(wint_t wc); int isideogram(wint_t wc); int isnumber(wint_t wc); int isphonogram(wint_t wc); int isspecial(wint_t wc); int iswalnum(wint_t wc); int iswascii(wint_t wc); int iswblank(wint_t wc); int iswcntrl(wint_t wc); int iswdigit(wint_t wc); int iswgraph(wint_t wc); int iswlower(wint_t wc); int iswprint(wint_t wc); int iswpunct(wint_t wc); int iswspace(wint_t wc); int iswupper(wint_t wc); int iswxdigit(wint_t wc); DESCRIPTION
These functions test whether wc is a wide-character code representing a character of a particular class defined in the LC_CTYPE category of the current locale. In all cases, wc is a wint_t, the value of which must be a wide-character code corresponding to a valid character in the current locale or must equal the value of the macro WEOF. If the argument has any other values, the behavior is undefined. iswalpha(wc) Tests whether wc is a wide-character code representing a character of class "alpha" in the program's current locale. isenglish(wc) Tests whether wc is a wide-character code representing an English language character, excluding ASCII characters. isideogram(wc) Tests whether wc is a wide-character code representing an ideographic language character, excluding ASCII characters. isnumber(wc) Tests whether wc is a wide-character code representing digit [0-9], excluding ASCII characters. isphonogram(wc) Tests whether wc is a wide-character code representing a phonetic language character, excluding ASCII characters. isspecial(wc) Tests whether wc is a wide-character code representing a special language character, excluding ASCII characters. iswalnum(wc) Tests whether wc is a wide-character code representing a character of class "alpha" or "digit" in the program's current locale. iswascii(wc) Tests whether wc is a wide-character code representing an ASCII character. iswblank(wc) Tests whether wc is a wide-character code representing a character of class "blank" in the program's current locale. This function is not available to applications conforming to standards prior to SUSv3. See standards(5). iswlower(wc) Tests whether wc is a wide-character code representing a character of class "lower" in the program's current locale. iswcntrl(wc) Tests whether wc is a wide-character code representing a character of class "cntrl" in the program's current locale. iswdigit(wc) Tests whether wc is a wide-character code representing a character of class "digit" in the program's current locale. iswgraph(wc) Tests whether wc is a wide-character code representing a character of class "graph" in the program's current locale. iswprint(wc) Tests whether wc is a wide-character code representing a character of class "print" in the program's current locale. iswpunct(wc) Tests whether wc is a wide-character code representing a character of class "punct" in the program's current locale. iswspace(wc) Tests whether wc is a wide-character code representing a character of class "space" in the program's current locale. iswupper(wc) Tests whether wc is a wide-character code representing a character of class "upper" in the program's current locale. iswxdigit(wc) Tests whether wc is a wide-character code representing a character of class "xdigit" in the program's current locale. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ |ATTRIBUTE TYPE |ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe with exceptions | +-----------------------------+-----------------------------+ The iswalpha(), iswalnum(), iswblank(), iswcntrl(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswpunct(), iswspace(), iswupper(), and iswxdigit() functions are Standard. SEE ALSO
localedef(1), setlocale(3C), stdio(3C), ascii(5), attributes(5), standards(5) SunOS 5.11 19 Apr 2004 iswalpha(3C)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy