Sponsored Content
Top Forums Shell Programming and Scripting Append ouput in a single line Post 302596119 by Corona688 on Monday 6th of February 2012 03:08:14 PM
Old 02-06-2012
Yep. You get newlines because you're adding newlines -- echo puts them on the end. If you don't want newlines, don't add newlines...

Code:
 printf "hello" > file
printf "world" >>file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Append 0 for single digit entered from command line

I have a script like this-- #!/bin/ksh echo "To pad a 0 before digits from 1-9" for i in $* do echo $i | sed 's//'0'/g' done I run this script as ksh name 1 2 23 34 The output should be 01 02 23 34 Help me in modifying this script. Thanks Namish (2 Replies)
Discussion started by: namishtiwari
2 Replies

2. Shell Programming and Scripting

to append data in a single row

Hi all, I need a logic in UNIX to append contents of a file in same row, where the original contents are found one below the other. For example. My i/p file contains: “user1”,”employee1”,”04/28/2009” “5678” “78” “user2”,”employee2”,”04/30/2009” I want my output... (8 Replies)
Discussion started by: Sgiri1
8 Replies

3. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

4. Shell Programming and Scripting

shell script - to append single quotes and comma

file1 ---- 34556745 32678343 31576776 31455566 21356666 I want to assign the record values to a variable in the below format, so that I can use output in .sql file for querying in database. ('34556745', '32678343', '31576776', '31455566', '21356666') ----------- below is the... (11 Replies)
Discussion started by: rajivrsk
11 Replies

5. UNIX for Dummies Questions & Answers

how to append into single file for multiple iterations

hi, i want to capture the CPU performance, memory , harddisk usage into a single file for every 10 seconds iterations and it shall run until i kill it. can somebody plz help me in this... thanx (1 Reply)
Discussion started by: bskumar4u
1 Replies

6. UNIX for Dummies Questions & Answers

Append a line to single column text file

I would like to add a line to the end of a single column text file. How do I go about doing that? Input: BEGIN 1 2 3 Output: BEGIN 1 2 3 END Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

7. UNIX for Advanced & Expert Users

Collect files from different servers to a single server and append them

Hi, I have script1.sh on 3 servers. I want to collect output report generated by them to a single server and append all the reports. Please tell me how can i do this? (2 Replies)
Discussion started by: pratikm23
2 Replies

8. UNIX for Dummies Questions & Answers

How to remove fields space and append next line to previous line.?

awk 'BEGIN{FS = "Ç"} NR == 1 {p = $0; next} NF > 1 {print p; p = $0} NF <= 1 {p = (p " " $0)} END {print p}' input.txt > output.txt This is what the input data file looks like with broken lines Code: 29863 Ç890000000 Ç543209911 ÇCHNGOHG Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies

9. Shell Programming and Scripting

Read 2 input and produce it in single ouput?

Hi all. I’ve 2 inputs here and would like to produce it in single ouput. I’ve drafted simple shell script but not sure how to put all this together. The final output should be “GROUP-XYZ” instead of “TEST” Please advise. INPUT1 GROUP-XYZ INPUT2 type8code0@box:~/dbedit$ cat... (8 Replies)
Discussion started by: type8code0
8 Replies

10. Shell Programming and Scripting

Remove new line starting with a numeric value and append it to the previous line

Hi, i have a file with multiple entries. After some tests with sed i managed to get the file output as follows: lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1, 00,2110597,2094790,0,81,529,75649011,56435363, lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies
RCVPACK(1)							     [nmh-1.5]								RCVPACK(1)

NAME
rcvpack - append message to file SYNOPSIS
/usr/lib/mh/rcvpack file [-mbox] [-mmdf] [-version] [-help] DESCRIPTION
The rcvpack program will append a copy of the message to the file listed on its command line. If the -mbox switch is given (the default), then the messages are separated using mbox (uucp) style delimiters. This is the format used by most mail clients (elm, mailx, etc.). If the -mmdf switch is given, then the messages are separated by mmdf style delimiters. Each message in the file is separated by four CTRL-A's and a newline. rcvpack will correctly lock and unlock the file to serialize access to the file, when running multiple copies of rcvpack . In general, its use is obsoleted by the file action of slocal, although it might still have occasional uses in various shell scripts. FILES
/etc/nmh/mts.conf nmh mts configuration file SEE ALSO
rcvdist(1), rcvstore(1), rcvtty(1), slocal(1) BUGS
Only two return codes are meaningful, others should be. MH.6.8 11 June 2012 RCVPACK(1)
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy