Sponsored Content
Full Discussion: Space truncation
Special Forums UNIX and Linux Applications Space truncation Post 302950427 by rbatte1 on Friday 24th of July 2015 11:33:42 AM
Old 07-24-2015
The difference is in the quoting. The shell will strip out multiple spaces.

Use echo "$a$b$c" instead.

Better still, you should also use {&} around variable names to clearly mark where they start and end and printf instead of echo so you would end up with:-
Code:
printf "${a}${b}${c}"

Unfortunately, echo can vary between vendors.



Robin
This User Gave Thanks to rbatte1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

solaris 2.5.1 /usr/ucb/ps truncation problems

we aheva couple of old sun OS boxes, that we are trying to parse /usr/ucb/ps output. However it seems that something is occuring that is causeing th output of "/usr/ucb/ps -auxwww" to cut short the process name, whereas "ps -eaf" can display the entire process name. It will work for a while... (2 Replies)
Discussion started by: adralph
2 Replies

2. UNIX for Advanced & Expert Users

truncation when vi a file

Hi, I'm using the vi that comes with Solaris 2.8. When vi a file with lines that have long continuous characters e.g. more than 256 chars, these lines got truncated. This is a known limitation of the out of the box Solaris vi, and there is a suggestion to get another vi. Is there an... (0 Replies)
Discussion started by: selur-xinu
0 Replies

3. UNIX for Advanced & Expert Users

What is the cause of file truncation?

Hi, I have a program that gets called from the front end of my application. Actually it creates some temporary files and uses them and deletes them at last. But sometimes, say once in 6 times, some of these temporary files are getting truncated in the middle and because of this my program is... (9 Replies)
Discussion started by: venkatmyname
9 Replies

4. AIX

PS output truncation in AIX

folks; i need help with a truncation problem in AIX when running "ps" command. when i run ps in SUN, i got the full output but when i run it in AIX the output is truncated. is there any arguments i can pass to give longer output so i can overcome the issue? here's the details:(please note the... (2 Replies)
Discussion started by: moe2266
2 Replies

5. UNIX for Advanced & Expert Users

STDOUT truncation

Operating system - Solaris 8, Korn shell, xterm Command /usr/proc/bin/ptree outputs the process tree exactly as I want with all detail However, /usr/proc/bin/ptree | more truncates the process descriptions at an 80 character point. If the process tree has marched enough to the right,... (3 Replies)
Discussion started by: JerryHone
3 Replies

6. UNIX for Advanced & Expert Users

Syslog Truncation / Size Limit?

I searched and could not find an answer to this, and am having difficulty, so I would appreciate any assistance that can be offered. We're experiencing logs that are having all characters after the 850th one written being truncated. I am wondering if there is a default limit to the syslog... (1 Reply)
Discussion started by: Puck
1 Replies

7. Post Here to Contact Site Administrators and Moderators

SCO 5.6 File truncation

Sir, my apologies for not being able to correspond for a long time. I am running an appliction in SCO 5.6. If the records are more than one lakh, the output file is getting truncated to one lakh. Please help me in rectifying the issue whereby it allows creation of output with more than one lakh... (0 Replies)
Discussion started by: chssastry
0 Replies

8. Filesystems, Disks and Memory

SCO 5.6 + file truncation

Sir, my apologies for I had put this question in a different forum earlier. I am running an appliction in SCO 5.6. If the records are more than one lakh, the output file is getting truncated to one lakh. Please help me in rectifying the issue whereby it allows creation of output with more than... (0 Replies)
Discussion started by: chssastry
0 Replies

9. UNIX for Advanced & Expert Users

Truncation Occurs When Outputting Shell Script to stderr

Operating System: Solaris 10, Shell We are outputting the results of our scripts to the stderr file. However we have encountered a problem where some of the lines in the file are truncated. Is there a way to increase the terminal or column size within the script so that this does not... (4 Replies)
Discussion started by: fazzasx
4 Replies

10. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies
ECHO(3) 								 1								   ECHO(3)

echo - Output one or more strings

SYNOPSIS
void echo (string $arg1, [string $...]) DESCRIPTION
Outputs all parameters. echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses. echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. Prior to PHP 5.4.0, this short syn- tax only works with the short_open_tag configuration setting enabled. I have <?=$foo?> foo. PARAMETERS
o $arg1 - The parameter to output. o $... - RETURN VALUES
No value is returned. EXAMPLES
Example #1 echo examples <?php echo "Hello World"; echo "This spans multiple lines. The newlines will be output as well"; echo "This spans multiple lines. The newlines will be output as well."; echo "Escaping characters is done "Like this"."; // You can use variables inside of an echo statement $foo = "foobar"; $bar = "barbaz"; echo "foo is $foo"; // foo is foobar // You can also use arrays $baz = array("value" => "foo"); echo "this is {$baz['value']} !"; // this is foo ! // Using single quotes will print the variable name, not the value echo 'foo is $foo'; // foo is $foo // If you are not using any other characters, you can just echo variables echo $foo; // foobar echo $foo,$bar; // foobarbarbaz // Some people prefer passing multiple parameters to echo over concatenation. echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . " "; echo <<<END This uses the "here document" syntax to output multiple lines with $variable interpolation. Note that the here document terminator must appear on a line with just a semicolon. no extra whitespace! END; // Because echo does not behave like a function, the following code is invalid. ($some_var) ? echo 'true' : echo 'false'; // However, the following examples will work: ($some_var) ? print 'true' : print 'false'; // print is also a construct, but // it behaves like a function, so // it may be used in this context. echo $some_var ? 'true': 'false'; // changing the statement around ?> NOTES
Note Because this is a language construct and not a function, it cannot be called using variable functions. SEE ALSO
print(3), printf(3), flush(3), Heredoc syntax. PHP Documentation Group ECHO(3)
All times are GMT -4. The time now is 12:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy