display the result of wc -l with words before and after the result


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers display the result of wc -l with words before and after the result
# 1  
Old 04-30-2008
display the result of wc -l with words before and after the result

hello

showrev -p | wc -l

returns:
381

What to do in case I want to have this output:

number of lines returned by showrev -p is: 381

thx
# 2  
Old 04-30-2008
hi

try this
echo "showrev -p is:`showrev -p | wc -l`"
# 3  
Old 04-30-2008
thank you.

Is there a way to get rid of the space returned by wc -l?

showrev -p returns: 338 lines

should be
showrev -p returns: 338 lines

thx
# 4  
Old 04-30-2008
Code:
echo "showrev -p is:`showrev -p | wc -l | sed 's/ *//g'`"
Edit/Delete Message

Pls use vB Codes when posting code samples and/or quoting anything. You;ve posted to these forums more than 100 times....
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare the current result with previous line result.?

Hi Gurus, I have requirement to compare current result with previous reuslt. The sample case is below. 1 job1 1 1 job2 2 1 job3 3 2 job_a1 1 2 job_a2 2 2 job_a3 3 3 job_b1 1 3 job_b2 2 for above sample file, GID is group ID, for input line, the job run... (1 Reply)
Discussion started by: ken6503
1 Replies

2. Shell Programming and Scripting

awk to parse file and display result based on text

I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Discussion started by: cmccabe
6 Replies

3. Shell Programming and Scripting

Bash script to display result in table

My script gives the following result. Is it possible to display the same in table format ? 1. rex_best Latest feeds are not avaialable. The last feed was generated on 2012-05-17 File Name = ekb_best_20120517_010949_665.tar.gz The Number of entry elements = 4209539 2. rex_genre Latest... (2 Replies)
Discussion started by: kishorekumar87
2 Replies

4. UNIX for Dummies Questions & Answers

what is the result of this?

ls -A $variable (2 Replies)
Discussion started by: prathimahsc
2 Replies

5. Shell Programming and Scripting

csh script to search for files and display result

Hello all. I'm a long time browser, first time poster...Be gentle :-) I don't use csh much, but have been asked to make a small script for our HP-UX systems to search for a report file(s) or summary file and display the result (I was using vuepad, but this probably is just complicating... (4 Replies)
Discussion started by: neillsm
4 Replies

6. Shell Programming and Scripting

Pick up the return code for every iteration and display the result only once in loop.

Hi All, I amlearning UNIX scripting. I have a small query. I would be thankful if any one helps me out. I have a below piece of code which delets the files. If file dosent have the permissions to delete a particular file I have used 2>>operator to track the error code. But my objective is... (1 Reply)
Discussion started by: manas6
1 Replies

7. Shell Programming and Scripting

display result from user input

how can i only display the result according to user input? For example: i have a data file(in the attachement), when the user enter "1" it will only display whole records with pid from the data file matches to the users entered. (13 Replies)
Discussion started by: thms_sum
13 Replies

8. Shell Programming and Scripting

Outputting formatted Result log file from old 30000 lines result log<help required>

Well I have a 3000 lines result log file that contains all the machine data when it does the testing... It has 3 different section that i am intrsted in 1) starting with "20071126 11:11:11 Machine Header 1" 1000 lines... "End machine header 1" 2) starting with "20071126 12:12:12 Machine... (5 Replies)
Discussion started by: vikas.iet
5 Replies

9. UNIX for Dummies Questions & Answers

Display result one page at a time

hi how can i display the result on the screen one page at a time? say i search for .txt files and return the result on the screen one page at a time. (4 Replies)
Discussion started by: nickaren
4 Replies
Login or Register to Ask a Question