-   Linux - Newbie (
-   -   Shell script - correction (

srnkumar 04-13-2006 09:52 AM

Shell script - correction
Following statements works fine in Solaris (/bin/sh) with default shell. When I run in Linux (sles 9)'s korn shell, errors out!!!

printf "%9-s" ${st}
print " "${attr}

How I can change these statements for proper output display?

druuna 04-14-2006 01:19 PM


This line: printf "%9-s" ${st} is incorrect, that should be:

printf "%-9s" ${st} the - left adjusts and I do believe it should be on the left of the digit.

I do find it strange that solaris doesn't complain about it...... Have to try that at work.

Anyway, hope this helps.

All times are GMT -5. The time now is 12:13 AM.