Sponsored Content
Full Discussion: how to lead space in value
Top Forums UNIX for Dummies Questions & Answers how to lead space in value Post 302419804 by Scott on Sunday 9th of May 2010 05:41:30 AM
Old 05-09-2010
Hi.

Typeset -L / -R works, but you have to quote the variable, otherwise the whitespace is removed:

Code:
$ typeset -R20 a=Hello
$ echo $a
Hello
$ echo "$a"
               Hello
$ typeset -L20 a=Hello
$ echo $a World 
Hello World
$ echo "$a"World
Hello               World

 

2 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Android Captures Smartphone Lead In U.S.

Reference (1 Reply)
Discussion started by: Neo
1 Replies

2. Gentoo

Help & lead me to the end. VFS: readonly/fs couldn't mount.

In a case of root=/dev/ram0 real_root=/dev/sda2 No filesystem could mount root, tried: ext3 ext2... Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) http://imageplay.net/img/tya22288136/IMG0204A.jpg (real_root - real panic) The case of omitting real_root and... (1 Reply)
Discussion started by: Xcislav
1 Replies
COLORS(3)						   libbash colors Library Manual						 COLORS(3)

NAME
colors -- libbash library for setting tty colors. SYNOPSIS
colorSet <color> colorReset colorPrint [<indent>] <color> <text> colorPrintN [<indent>] <color> <text> DESCRIPTION
General colors is a collection of functions that make it very easy to put colored text on tty. The function list: colorSet Sets the color of the prints to the tty to COLOR colorReset Resets current tty color back to normal colorPrint Prints TEXT in the color COLOR indented by INDENT (without adding a newline) colorPrintN The same as colorPrint, but trailing newline is added Detailed interface description follows. Available colors: Green Red Yellow White The color parameter is non-case-sensitive (i.e. RED, red, ReD, and all the other forms are valid and are the same as Red). FUNCTIONS DESCRIPTIONS
colorSet <color> Sets the current printing color to color. colorReset Resets current tty color back to normal. colorPrint [<indent>] <color> Prints text using the color color indented by indent (without adding a newline). Parameters: <indent> The column to move to before start printing. This parameter is optional. If ommitted - start output from current cursor position. <color> The color to use. <color> The text to print. colorPrintN [<indent>] <color> The same as colorPrint, except a trailing newline is added. EXAMPLES
Printing a green 'Hello World' with a newline: Using colorSet: $ colorSet green $ echo 'Hello World' $ colorReset Using colorPrint: $ colorPrint 'Hello World'; echo Using colorPrintN: $ colorPrintN 'Hello World' AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <gil@ran4.net> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 08:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy