Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display from a variable using echo. Post 37108 by jagannatha on Thursday 12th of June 2003 03:06:59 PM
Old 06-12-2003
Display from a variable using echo.

I have a variable that is outputting a lot of space.

here has been 45 lines returned ...

how can I remove the spaces between the "been and the 45"
CODE:

fil_len=`wc -l < coshb.txt`
if [ ${fil_len} -gt 21 ]; then
cat coshb.txt | more
echo " "
echo "There has been ${fil_len} lines returned ..."

I am using a ksh in Solaris.

Thank in advance
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Echo display alignment/sort order

Hi, My script prints a few varibales as each it reads each line of a text file and then prints them on screen, however iam having problem in aligning and sorting them. what happens is this Last First Number Mark leo 87798798... (1 Reply)
Discussion started by: shackman66
1 Replies

2. Shell Programming and Scripting

assigning variable value using echo

I am modifying an existing script and it has the following line: export SomeEnvVar=`echo ${SomeLocalVar}` Why wouldn't it just read: export SomeEnvVar=${SomeLocalVar} Is there some reason to use echo instead of a direct assignment? :confused: (2 Replies)
Discussion started by: shellburger
2 Replies

3. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies

4. Shell Programming and Scripting

Display echo results in three column

Dear Friends, I have my command output which displays on one row and values are now scrollable (vertical) 3 pages. How do i display those output in three column so that i no need to scroll? Example: dcadd$cat components 1.Caluculator 2.Diary ... ... 50.Mobile 51.Battery .. ...... (12 Replies)
Discussion started by: baluchen
12 Replies

5. Shell Programming and Scripting

echo display problem

Hi I am facing a strange problem a=03 echo ${a} the output is 3 But i want to display it is 03 Can you people help me how to display it like 03. Thanks (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

6. Shell Programming and Scripting

Display and write in file in one echo command

Hi All, I want to display content on command promt and also write in file. For that iI ahve to write two sentence echo "XXXXXXX" echo "XXXXXXXX" >> 1.txt Is there any way to write in one echo statement (1 Reply)
Discussion started by: vivek1489
1 Replies

7. UNIX for Dummies Questions & Answers

How to assign echo in variable

I've testing the following code: echo test.txt | cut -d . -f1and get the output "text" So why can't i assign the command to a variable? VAR='"echo test.txt | cut -d . -f1"' echo $VAR (5 Replies)
Discussion started by: jl487
5 Replies

8. Homework & Coursework Questions

Using ls or echo to display a specific output

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: What single command line would you enter to get the following output? 8140 drwxr-xr-x 9 root bin 18 Jan 20... (6 Replies)
Discussion started by: dasboot
6 Replies

9. Shell Programming and Scripting

echo the NAME of the variable

#!/bin/bash varA="AAA1" varB="BBB2" varC="CCC3" for proccx in $varA $varB $varC do echo "the current name is ????? , the value is $proccx" echo " " done #end of script I want the output to look something like this: the current name is varA, the value is AAA1 the current name is... (5 Replies)
Discussion started by: ajp7701
5 Replies

10. Shell Programming and Scripting

display echo only once

lets say I am printing something out echo "Please enter a valid username" and its being printed out 5 times, is there any way I can limit to only being displayed ONCE. I tried echo -n but that just makes everything fit on one line. Right now it keeps saying Please enter a valid... (5 Replies)
Discussion started by: subway69
5 Replies
XDIFF_STRING_DIFF(3)							 1						      XDIFF_STRING_DIFF(3)

xdiff_string_diff - Make unified diff of two strings

SYNOPSIS
string xdiff_string_diff (string $old_data, string $new_data, [int $context = 3], [bool $minimal = false]) DESCRIPTION
Makes an unified diff containing differences between $old_data string and $new_data string and returns it. The resulting diff is human- readable. An optional $context parameter specifies how many lines of context should be added around each change. Setting $minimal parameter to true will result in outputting the shortest patch file possible (can take a long time). PARAMETERS
o $old_data - First string with data. It acts as "old" data. o $new_data - Second string with data. It acts as "new" data. o $context - Indicates how many lines of context you want to include in the diff result. o $minimal - Set this parameter to TRUE if you want to minimalize the size of the result (can take a long time). RETURN VALUES
Returns string with resulting diff or FALSE if an internal error happened. EXAMPLES
Example #1 xdiff_string_diff(3) example The following code makes unified diff of two articles. <?php $old_article = file_get_contents('./old_article.txt'); $new_article = $_REQUEST['article']; /* Let's say that someone pasted a new article to html form */ $diff = xdiff_string_diff($old_article, $new_article, 1); if (is_string($diff)) { echo "Differences between two articles: "; echo $diff; } ?> NOTES
Note This function doesn't work well with binary strings. To make diff of binary strings use xdiff_string_bdiff(3)/xdiff_string_rabd- iff(3). SEE ALSO
xdiff_string_patch(3). PHP Documentation Group XDIFF_STRING_DIFF(3)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy