10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix.
I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice.
Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
2. UNIX for Dummies Questions & Answers
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies
3. Shell Programming and Scripting
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Discussion started by: Ferocci
8 Replies
4. Shell Programming and Scripting
this is the requirement
list.txt
table1
table2
table3
testfile.txt
name#place#data#select * from table1
name2#place2#data2#select * from table 10 innerjoin table3
name2#place2#data2#select * from table 10
output
name place table1
name2 place table3
i tried using awk (7 Replies)
Discussion started by: vamsekumar
7 Replies
5. Shell Programming and Scripting
I am connecting to a device using telnet, I want my script to perform certain commands : ie- show device , show inventory..etc and write the output it sees from the terminal to a file.
this is what I have got :
#!/usr/bin/expect --
set running 1
spawn telnet <ip address>
expect ... (1 Reply)
Discussion started by: samantha123
1 Replies
6. Shell Programming and Scripting
i have 3 files as below:
i want to print 1st,2nd,5th and 10th filed of 1st to 5th lines from each files into a line of an output file, so the result would be:
:
{line1}(field 1 of line 1 from file 1)(field 2 of line 1 from file 1)(field 5 of line 1 from file 1)(field 10 of line 1 from file... (1 Reply)
Discussion started by: saeed.soltani
1 Replies
7. Shell Programming and Scripting
Hi all,
I have a script that is monitoring a hot folder. This script works fine with one exception when the script is executed while a file is being copied to the hot folder.
What is the easiest method to check if the copy file is completed? I'd like to get the solution in bash :) (8 Replies)
Discussion started by: gigagigosu
8 Replies
8. Shell Programming and Scripting
So basically what I want to do is pull out DNA sequences for a particular gene name.
I have 2 files (FILE1 and FILE2) and I want an output into a separate file (FILE3).
FILE1 and 2 are MASSIVE so I am only posting examples from each file.
So FILE1 looks like this (tab deliminted, 4... (3 Replies)
Discussion started by: kylle345
3 Replies
9. Shell Programming and Scripting
Need shell script to read two file at same time and print output in single file
Example I have two files 1) file1.txt 2) file2.txt
File1.txt contains
Aaa
Bbb
Ccc
Ddd
Eee
Fff
File2.txt contains
Zzz
Yyy
Xxx (10 Replies)
Discussion started by: sreedhargouda
10 Replies
10. UNIX for Advanced & Expert Users
If I download a file via SFTP how can I tell when the process is completed? Is there a process that I can monitor?
Thanks (3 Replies)
Discussion started by: goodmis
3 Replies
CAT(1) General Commands Manual CAT(1)
NAME
cat - catenate and print
SYNOPSIS
cat [ -u ] [ -n ] [ -s ] [ -v ] file ...
DESCRIPTION
Cat reads each file in sequence and displays it on the standard output. Thus
cat file
displays the file on the standard output, and
cat file1 file2 >file3
concatenates the first two files and places the result on the third.
If no input file is given, or if the argument `-' is encountered, cat reads from the standard input file. Output is buffered in the block
size recommended by stat(2) unless the standard output is a terminal, when it is line buffered. The -u option makes the output completely
unbuffered.
The -n option displays the output lines preceded by lines numbers, numbered sequentially from 1. Specifying the -b option with the -n
option omits the line numbers from blank lines.
The -s option crushes out multiple adjacent empty lines so that the output is displayed single spaced.
The -v option displays non-printing characters so that they are visible. Control characters print like ^X for control-x; the delete char-
acter (octal 0177) prints as ^?. Non-ascii characters (with the high bit set) are printed as M- (for meta) followed by the character of
the low 7 bits. A -e option may be given with the -v option, which displays a `$' character at the end of each line. Specifying the -t
option with the -v option displays tab characters as ^I.
SEE ALSO
cp(1), ex(1), more(1), pr(1), tail(1)
BUGS
Beware of `cat a b >a' and `cat a b >b', which destroy the input files before reading them.
4th Berkeley Distribution May 5, 1986 CAT(1)