Sponsored Content
Top Forums Shell Programming and Scripting append a line into a file in the top Post 302362154 by Amit.Sagpariya on Thursday 15th of October 2009 06:19:46 AM
Old 10-15-2009
Becuase, you are sorting in your script.

Code:
cat L9_Recharge_Description_summary_EOM_$date_rep.o|sort > L9_Recharge_Description_summary_EOM_$date_rep.csv

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Append a Value to each line of the file

Hi, We have Multiple source files which has some data, I need a K shell script which will append number '1' as the last character to all the lines of the first file and then increments the value and appends '2' to all the lines to the next file and so on. For Example Incoming file 1 ... (11 Replies)
Discussion started by: dsshishya
11 Replies

2. AIX

want to remove some line from top of file.

Hi All, I have AIX 5.3 server. I have one big file. in that i want to remove 5000 line from top. is there any command for this? Thanks, Vishal (6 Replies)
Discussion started by: vishalpatel03
6 Replies

3. Shell Programming and Scripting

best way to insert a line at the top of a file?

say I want to insert "this is a test" as the first line into file A, besides echo "this is a test" > /tmp/tmpfile cat /tmp/tmpfile fileA >> /tmp/result, is there any simple way I can do it? thanks (7 Replies)
Discussion started by: fedora
7 Replies

4. Shell Programming and Scripting

Append each line to next previous line in a file

Hi all, Please help me in providing sample code to append the following 4 lines in one row. Input : A1/EXT "BAPBSC10/07B/00" 523 090530 0115 RXOCF-430 HY1711 1 EXTERNAL ALARM DOOR ALARM Output should be : A1/EXT "BAPBSC10/07B/00" 523 090530 0115 ... (8 Replies)
Discussion started by: sudhakaryadav
8 Replies

5. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

6. UNIX for Dummies Questions & Answers

add a new line on top of a file

infile a b c A E F 1 2 3 outfile new line a b c A E F 1 2 3 I tried: sed '1i\ new line' infile > outfilecat outfile new linea b c A E F 1 2 3 I don't want the new line be added to the existing first line. Thanks Joseph (7 Replies)
Discussion started by: jdhahbi
7 Replies

7. Shell Programming and Scripting

How to append text to the second line of a file

Say I have a text file like: 1 3 4 How would I use ksh to put the number '2' into the second line of that file? I'm using OpenBSD so the sed syntax might be a bit different (I have no idea how to use sed, though) (4 Replies)
Discussion started by: guitarscn
4 Replies

8. Shell Programming and Scripting

conditional append one line in file.

Hi, Unix gurus, I have a requirement as following: checking existing file, if the file only contain one line. then append "No data" else keep existing file as is. can i achieve this by in command line without write a script. :wall: Thanks in advance. (4 Replies)
Discussion started by: ken002
4 Replies

9. Shell Programming and Scripting

Append file name to the beginning of each line

I want to append file names at the beginning of a line for each row file content abc.txt.gz 123|654|987 bcd.txt.gz 876|trf|kjh I want a single output file with below format abc.txt.gz|123|654|987 bcd.txt.gz|876|trf|kjh This one is working but only with unzip files,need to have... (3 Replies)
Discussion started by: rakesh5300
3 Replies

10. Shell Programming and Scripting

Move a line to top of the file

Hi, I have a following file and it has only one occurrence of line that says "Output view:". It could be in middle somewhere ( i don't know the exact location ). I want to move it as the first line of the file. Input AAA BBBB CCCC Output view: XXXX YYYY ZZZZ Output should be: Output... (13 Replies)
Discussion started by: jakSun8
13 Replies
SHTOOL-ECHO.TMP(1)					      GNU Portable Shell Tool						SHTOOL-ECHO.TMP(1)

NAME
shtool-echo - GNU shtool echo(1) extensional command SYNOPSIS
shtool echo [-n|--newline] [-e|--expand] string DESCRIPTION
shtool echo is an echo(1) style command which prints string to stdout and optionally provides special expansion constructs (terminal bold mode, environment details, date, etc) and newline control. The trick of this command is that it provides a portable -n option and hides the gory details needed to find out the environment details under option -e. OPTIONS
The following command line options are available. -n, --newline By default, output is written to stdout followed by a "newline" (ASCII character 0x0a). If option -n is used, this newline character is omitted. -e, --expand If option -e is used, string can contain special "%x" constructs which are expanded before the output is written. Currently the following constructs are recognized: %B switch terminal mode to bold display mode. %b switch terminal mode back to normal display mode. %u the current user name. %U the current user id (numerical). %g the current group name. %G the current group id (numerical). %h the current hostname (without any domain extension). %d the current domain name. %D the current day of the month. %M the current month (numerical). %m the current month name. %Y the current year. EXAMPLE
# shell script shtool echo -n -e "Enter your name [%B%u%b]: "; read name shtool echo -e "Your Email address might be %u@%h%d" shtool echo -e "The current date is %D-%m-%Y" HISTORY
The GNU shtool echo command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for Website META Language (WML) under the name buildinfo. It was later taken over into GNU shtool. SEE ALSO
shtool(1), echo(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-ECHO.TMP(1)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy