Merging two command into single line


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Merging two command into single line
# 1  
Old 02-04-2009
Merging two command into single line

1. du -sch int* | grep "total" | awk '{print $1}'
first command result is
17K
2. echo "B"
Result
B

i want the output is 17KB
# 2  
Old 02-04-2009
Bug

echo `du -sch int* | grep "total" | awk '{print $1}'`B
# 3  
Old 02-04-2009
Code:
du -sch int* | awk '/total/{print $1"B"}'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Merging multiple lines into single line based on one column

I Want to merge multiple lines based on the 1st field and keep into single record. SRC File: AAA_POC_DB.TAB1 AAA_POC_DB.TAB2 AAA_POC_DB.TAB3 AAA_POC_DB.TAB4 BBB_POC_DB.TAB1 BBB_POC_DB.TAB2 CCC_POC_DB.TAB6 OUTPUT ----------------- 'AAA_POC_DB','TAB1','TAB2','TAB3','TAB4'... (10 Replies)
Discussion started by: raju2016
10 Replies

2. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

3. Shell Programming and Scripting

Su and run single line command

myenv.sh script sets LOG_DIR variable. I can run the script and echo the variable in a single line as: # First set LOG_DIR to some dummy 'NONE' value $ export LOG_DIR="NONE" $ echo ${LOG_DIR} NONE $ cat /tmp/bin/myenv.sh export LOG_DIR="/tmp/log" #The below command doesn't show the... (2 Replies)
Discussion started by: ysrini
2 Replies

4. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

5. Shell Programming and Scripting

Help with merging data into single line.

Hi, My input is <message> looking for a big <message>Does fit my G74 laptop. Makes the 10 pound. <message> <message>This bag is the only one I could find to fit my awesome ASUS G74S. <message> <message> Great bag my only wish is that they had put a pocket in which to store and... (6 Replies)
Discussion started by: pamu
6 Replies

6. Shell Programming and Scripting

merging multiple lines into single line

Hi, 1. Each message starts with date 2. There is blank line between each message 3. Each message does not contain same number of lines. Any help in merging multiple lines in each message to a single line is much appreciated. AIX: Korn Shell Error log file looks like below. ... (5 Replies)
Discussion started by: bala123
5 Replies

7. Shell Programming and Scripting

a few single line command

i m trying to find the answers of a past year exam questions , i m sure it ll be very easy for u guys , this is not a hw assignment or somth. i just wanna be sure of right answers . write a single instruction to perform each of the following tasks: (u r allowed to use c shell, and u can use... (2 Replies)
Discussion started by: brhn
2 Replies

8. Shell Programming and Scripting

merging similar columns in a single line file

Hi Guys. I have tried the commands sort and join. But I couldn't able to to find the command for joining in a single line based on keys.My example inputs and outputs are like the following. Help would be appreciated.:D Input file a1tabXXXXXXX a2tabXXXXXXX a6tabYYYYYYYYY a71tabXXXXXXX... (7 Replies)
Discussion started by: repinementer
7 Replies

9. AIX

ls command output in single line

Hi, Can anyone suggest me how can I display the output of ls command in single line with some delimiter say pipe (|)? I know it can be done by writing a script by using the loops but I wanted to know are there any other single line commands? Thanks for your help Sheshadri (7 Replies)
Discussion started by: arsheshadri
7 Replies

10. Shell Programming and Scripting

single line command

i need to search for a single pattern in three different logs....what would be the best one line script???? (4 Replies)
Discussion started by: roshanjain2
4 Replies
Login or Register to Ask a Question