01-13-2007
checkout this command for getting only the diff output without > 2a3
diff 2.txt 3.txt|awk 'NR==2 {print$2}'
or
diff 2.txt 3.txt|sed "1 d"|awk '{print$2}'
which ever suits your requirement
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I had to delete rows when a record was missing a field. My solution was
cut -c 202-402 ${dataFile} | awk '{if (substr($0,103,30) !~ /^ *$/) print $0} >> ${workFile}
The cut is because they came two records to a row.
Anyone want to offer a more elegant solution? (2 Replies)
Discussion started by: gillbates
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a .txt file
Sample:
=====================
NEXT HOST
=====================
AEADBAS001
ip access-list extended BLA_Incoming_Filter
ip access-list extended BLA_Outgoing_Filter
access-list 1 permit xxxxxxxxxxxxxx
access-list 2 permit xxxxxxxxxxxxxx
=====================... (4 Replies)
Discussion started by: I-1
4 Replies
3. UNIX for Dummies Questions & Answers
When I use this command I get an output of some numbers
cat ac.20070511 | cut -d" " -f19
Is there any way for me to display only the numbers that are greater than 1000 but not all the numbers in the ouput.
Can any one help me with this. :) (8 Replies)
Discussion started by: venu_nbk
8 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have two files say A and B, Both files have some common records few records which are unique to file A and unique to file B.
Can anyone please help me out to find the records which are present in only B
Please consider the files are of too large size.
Thanks:confused: (1 Reply)
Discussion started by: Shiv@jad
1 Replies
5. Shell Programming and Scripting
Hi All,
I've got a script to output YAML data, and I want to display data that's held inside variables inside one large CAT area. What's the easiest way to do this?
cat << "END"
---
classes:
- general_image
- $intro #Variable 1
- $mid #Variable 2
... (2 Replies)
Discussion started by: glarizza
2 Replies
6. Shell Programming and Scripting
Hello attempting to redirect out to create a startup script in solaris. The steps are working but the $1 entry is being left out. syntax below and content of output file below.
cat > S99build << EOF
> #!/bin/bash
> case $1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
>... (3 Replies)
Discussion started by: juanb25
3 Replies
7. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
8. Shell Programming and Scripting
Hi,
I have thousands of data in 1 file that need to be sorted out. My file is like below:-
File1.txt
condition 1
scaf_27 CDS 48317 48517 "e_gww2.27.12.1" Id 35277
scaf_27 stop_cod 48317 48319 "e_gww2.27.12.1"
scaf_27 CDS 48518 49107 "e_gww2.27.12.1" ... (4 Replies)
Discussion started by: redse171
4 Replies
9. Shell Programming and Scripting
I have a script to do a couple simple but repetitive commands on files that are provided to us. One of the things is to get rid of the line feeds. This is the section that is causing problems, i even cut this section into its own file to make sure nothing else was affecting it.
#!/usr/bin/bash... (4 Replies)
Discussion started by: oly_r
4 Replies
10. Shell Programming and Scripting
I have a fixed width file. The records looks something similar to below:
Type ID SSN NAME .....AND SOME MORE FIELDS
A1 1234 .....
A1 1234 .....
B1 1234 .....
M2 4567 .....
M2 4567 .....
N2 4567 .....
N2 4567 .....
A1 9999
N2 9999
Now if A1 is present then B1 has to be present.... (2 Replies)
Discussion started by: Saanvi1
2 Replies
BZDIFF(1) General Commands Manual BZDIFF(1)
NAME
bzcmp, bzdiff - compare bzip2 compressed files
SYNOPSIS
bzcmp [ cmp_options ] file1 [ file2 ]
bzdiff [ diff_options ] file1 [ file2 ]
DESCRIPTION
Bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files. All options specified are passed directly to
cmp or diff. If only 1 file is specified, then the files compared are file1 and an uncompressed file1.bz2. If two files are specified,
then they are uncompressed if necessary and fed to cmp or diff. The exit status from cmp or diff is preserved.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWbzip |
+--------------------+-----------------+
|Interface Stability | External |
+--------------------+-----------------+
SEE ALSO
cmp(1), diff(1), bzmore(1), bzless(1), bzgrep(1), bzip2(1)
BUGS
Messages from the cmp or diff programs refer to temporary filenames instead of those specified.
BZDIFF(1)