04-26-2010
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how can I add data from command line to end of file? (3 Replies)
Discussion started by: bryan
3 Replies
2. Shell Programming and Scripting
Hi,
Am trying to write a shell script which will append a header and a footer to an existing file. Header will contain details like the current date while the footer will contain the no: of records listed in the file.
I know we can use the CAT command, but i have no clue abt the syntax to... (4 Replies)
Discussion started by: brainstormer
4 Replies
3. Shell Programming and Scripting
I have a bunch of files named publish.php within subdirs. I need to append a line at the end of each file. I thought I could do it with find and echo like this:
find . -name publish.php -exec echo "<? include('path/to/file.php'); ?>" >> '{}' \;
but that appends the line to a file named {}... (2 Replies)
Discussion started by: surroscape
2 Replies
4. Shell Programming and Scripting
Hi Experts,
Am relatively new to shell programming so would appreciate some help in this regard.
I am looking at reading from a file, line by line, picking the first word of each line and appending it to the end of the line.
Any suggestions?
INPUT FILE -
3735051 :... (7 Replies)
Discussion started by: hj007
7 Replies
5. Shell Programming and Scripting
A friend contacted me recently with an interesting question. We got something worked out, but I'm curious what answers you all can come up with.
Given a shell script (in bash) that processes a bunch of data and appends it to a file, how would you append the date, time, and a filename to the... (6 Replies)
Discussion started by: malcolmpdx
6 Replies
6. UNIX for Dummies Questions & Answers
I am trying to sort data within a text document by the information at the end of each line. Please see below for an example:
<Profile_0 Name="Random name 0" Description="This is the description." Category="System" ProfileFlags.DWD="6" ABCD="{FF350E61-4FFF-4600-BFFF-3B27DD4BA746}"/>... (6 Replies)
Discussion started by: Davinator
6 Replies
7. Shell Programming and Scripting
hi,
i m having a group of files starting with name 'Itemdelete<timestamp>' .
my requirment is to append a blank line at the end of files ,using unix in all the Itemdelete* files with a single unix command without using scripts.can any body put some light to this requiremnt.
regards
Angel (4 Replies)
Discussion started by: angel12345
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
My requirement is to append a date in format DDMMYYYYHHMISS at the end of first line of file which is HEADER. I am trying command
sed -i '1s/.*/&<date_format>/' <file_name>
Where <date_format>=`date +%m%d%Y%H%M%S`
I am somehow misisng the right quotes ti get this added in above... (2 Replies)
Discussion started by: sanjaydubey2006
2 Replies
9. UNIX for Dummies Questions & Answers
I have a text file in which all records end with pipe character and newline, but a few do not have a pipe at the end.
Something like this
1|John|32|US|
2|Matt|35|UK
3|Rex|36|EU|
So in the above example the second line does not have a pipe at the end
My requirement is to append a... (5 Replies)
Discussion started by: abhilashnair
5 Replies
10. UNIX for Beginners Questions & Answers
I am trying to add a date variable to the end of each line. This is what I have to start with
cat ${DATAPATH}/Participate_Stream${STREAMDATE}.dryak1.csv | grep ^',' | awk '{print $0}' >> ${DATAPATH}/badparticipant.csv
This is what I tried $DATE is a variable I have defined.
cat... (3 Replies)
Discussion started by: req62861
3 Replies
LEARN ABOUT DEBIAN
plan9-cat
CAT(1) General Commands Manual CAT(1)
NAME
cat, read, nobs - catenate files
SYNOPSIS
cat [ file ... ]
read [ -m ] [ -n nline ] [ file ... ]
nobs [ file ... ]
DESCRIPTION
Cat reads each file in sequence and writes it on the standard output. Thus
cat file
prints a file and
cat file1 file2 >file3
concatenates the first two files and places the result on the third.
If no file is given, cat reads from the standard input. Output is buffered in blocks matching the input.
Read copies to standard output exactly one line from the named file, default standard input. It is useful in interactive rc(1) scripts.
The -m flag causes it to continue reading and writing multiple lines until end of file; -n causes it to read no more than nline lines.
Read always executes a single write for each line of input, which can be helpful when preparing input to programs that expect line-at-a-
time data. It never reads any more data from the input than it prints to the output.
Nobs copies the named files to standard output except that it removes all backspace characters and the characters that precede them. It is
useful to use as $PAGER with the Unix version of man(1) when run inside a win (see acme(1)) window.
SOURCE
/src/cmd/cat.c
/src/cmd/read.c
/bin/nobs
SEE ALSO
cp(1)
DIAGNOSTICS
Read exits with status eof on end of file or, in the -n case, if it doesn't read nlines lines.
BUGS
Beware of and which destroy input files before reading them.
CAT(1)