LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-13-2006, 09:52 AM   #1
srnkumar
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
Lightbulb 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?
 
Old 04-14-2006, 01:19 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

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.
 
  


Reply

Tags
script, shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 03:14 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
Gamma correction is ignored rwhitworth Suse/Novell 0 11-26-2005 08:56 AM
vim spelling correction arvindn Linux - Software 0 12-02-2003 03:58 AM


All times are GMT -5. The time now is 09:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration