The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk to echo ??? jisha Shell Programming and Scripting 2 04-11-2008 03:51 AM
What does echo ^[[r do? hamsasal UNIX for Advanced & Expert Users 1 07-24-2005 02:14 PM
swap space / paging space aaronh AIX 2 05-19-2004 11:06 AM
pageing space vs swap space VeroL UNIX for Dummies Questions & Answers 1 01-22-2004 11:54 AM
echo ????? nguda UNIX for Dummies Questions & Answers 1 06-30-2003 05:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2004
laila63 laila63 is offline
Registered User
  
 

Join Date: May 2004
Posts: 66
How to echo a <tab> space?

I've tried this:

Code:

echo "${bold}User${norm} : u"\t"${bold}All Users   ${norm} : a\t"

and i got this output:

Specific User : u\tAll User: a\t
  #2 (permalink)  
Old 07-01-2004
laila63 laila63 is offline
Registered User
  
 

Join Date: May 2004
Posts: 66
Apologies for this, i meant to start a new thread but clicked on the wrong button
  #3 (permalink)  
Old 07-01-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
I split the thread... and I merged it with your other thread...

There are many versions of echo around. We would need to know your system and your shell. But here is something to try....

Where you have \t replace that with a real tab character.
  #4 (permalink)  
Old 07-01-2004
laila63 laila63 is offline
Registered User
  
 

Join Date: May 2004
Posts: 66
i'm running this on Linux actually. Thanks for the suggestion to use printf. This script needs to be able to execute across platforms (Unix, Linux, Solaris), from Driver's comment i assume that printf would be more portable. correct me if i'm wrong.

Thanks again!!
  #5 (permalink)  
Old 07-02-2004
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,807
printf is POSIX.2 compliant - in plain English it should be available on any Unix that claims to support POSIX standards. Old system may not have it.

printf works a lot like the C library function with the same name, except it works from the command line. It's pretty cool.

The reason POSIX standards exist is to help people who want have their code work correctly on different flavors of Unix.
  #6 (permalink)  
Old 07-02-2004
laila63 laila63 is offline
Registered User
  
 

Join Date: May 2004
Posts: 66
i've seen scripts that use print instead of printf. what's the difference btwn the two?
  #7 (permalink)  
Old 07-02-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
print is a ksh built-in command. printf is an external program. They have very different syntax. See the man pages for details.
Closed Thread

Bookmarks

Tags
linux, linux commands, solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0