Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Does anyone have a trick to run sdiff to display the filenames as a header? Post 303028798 by RudiC on Tuesday 15th of January 2019 08:49:10 AM
Old 01-15-2019
How about - if your shell offers "process substitution" -


Code:
sdiff <(echo file3; cat file3) <(echo file3~; cat file3~)
file3                                                         |  file3~
DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS11/MoN-MVW.out:::   Tota    DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS11/MoN-MVW.out:::   Tota
DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS7/MoN-MVW.out:::    Tota    DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS7/MoN-MVW.out:::    Tota
DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS9/MoN-MVW.out:::    Tota    DISTANCIA1.45_SIMETRIA1_GIRO2_ACTIVOS9/MoN-MVW.out:::    Tota
DISTANCIA1.45_SIMETRIA1_GIRO4_ACTIVOS11/MoN-MVW.out:::   Tota    DISTANCIA1.45_SIMETRIA1_GIRO4_ACTIVOS11/MoN-MVW.out:::   Tota
DISTANCIA1.45_SIMETRIA1_GIRO1_ACTIVOS11/MoN-MVW.out:::   Tota <

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sdiff ? problem

Hello, I'm using Sdiff to compare 2 files, I've used this before and it works fine and still does in some cases. But it seems to trip up when using combinations of alpha-numeric text. I created two simple files to test and as you can see it seems to trip up on the "gr55a" text, any ideas ? ... (2 Replies)
Discussion started by: cowpoke
2 Replies

2. UNIX for Dummies Questions & Answers

A more intelligent SDIFF

Hi all I have two files which are essentially the same. However the way an exponent is written is different (i.e. in 1 file, a particular number might be written as 1.43230000E+02 whereas in another it might be 1.4323E2). If I use SDIFF then the program will merely check the ASCII characters... (1 Reply)
Discussion started by: robbiegregg
1 Replies

3. AIX

Can I display err log again after run errclear

After run errclear, it will clean the err log file. After that, if I still need display the log has been cleared by errclear, how can I do? thanks (5 Replies)
Discussion started by: rainbow_bean
5 Replies

4. UNIX for Dummies Questions & Answers

Display just CPU run queue number (Nothing Else)

Im using the vmstat command to display the CPU run queue, but i want to put that into a program so is there a way to just display the number under the r? Thanks, (1 Reply)
Discussion started by: RAFC_99
1 Replies

5. Shell Programming and Scripting

Using sdiff without files

Hi, I'm trying to use sdiff by parsing the output of another command instead of the filename: sdiff <(echo test1) <(echo test2)However, this seems to cause my terminal session to stop working. If I use it with normal diff it works fine: ~$ diff <(echo test1) <(echo test2) 1c1 < test1... (4 Replies)
Discussion started by: Subbeh
4 Replies

6. Shell Programming and Scripting

Sdiff query

I wanted to ask can sdiff be used for comparing files which are present in different network?? If yes then how? Thanks in Advance!!!!!!! (1 Reply)
Discussion started by: bhavanabahety
1 Replies

7. UNIX for Dummies Questions & Answers

Display header in script output

Hi -- Working on my own through the book "Learning the KornShell and came to task 4-1, which there is: a script "highest" and it will sort an "album" file. highest filename The author mentions adding a header line to the scripts output if the user types in the -h option. It says "assume the... (9 Replies)
Discussion started by: Decoy Octopus88
9 Replies

8. Shell Programming and Scripting

Sdiff command

Hi i am comparing file on 2 different machine with the help of script. however i am get below o/p ======= /usr/tmp ========= ======= /usr/tmp not a regular file i am not sure what does "not a regular file mean" . is it something serious, if yes then what i need to check or we can... (1 Reply)
Discussion started by: scriptor
1 Replies

9. Shell Programming and Scripting

How to display the header of a matched row in a file?

Hi, So I am trying to print the first row(header) first column alongwith the matched value. But I am not sure how do I print the same, by matching a pattern located in the file eg File contents Name Place Jim NY Jill NJ Cathy CA Sam TX Daniel FL And what I want is... (2 Replies)
Discussion started by: sidnow
2 Replies

10. UNIX for Beginners Questions & Answers

Sdiff

file1: USER:XACME\cn3937 User:XACME\z01220 User:XACME\z01404 User:XACME\z02102 User:XACME\U17234 File2: USER:XACME\lawson USER:XACME\cn7913 USER:XACME\cn8037 USER:XACME\cn8042 USER:XACME\cn8046 USER:XACME\u31645 USER:XACME\u19050 USER:XACME\U28715 USER:XACME\U17234 USER:XACME\cn3937... (2 Replies)
Discussion started by: loktamann
2 Replies
SDIFF(1)							   User Commands							  SDIFF(1)

NAME
sdiff - side-by-side merge of file differences SYNOPSIS
sdiff [OPTION]... FILE1 FILE2 DESCRIPTION
Side-by-side merge of differences between FILE1 and FILE2. Mandatory arguments to long options are mandatory for short options too. -o, --output=FILE operate interactively, sending output to FILE -i, --ignore-case consider upper- and lower-case to be the same -E, --ignore-tab-expansion ignore changes due to tab expansion -Z, --ignore-trailing-space ignore white space at line end -b, --ignore-space-change ignore changes in the amount of white space -W, --ignore-all-space ignore all white space -B, --ignore-blank-lines ignore changes whose lines are all blank -I, --ignore-matching-lines=RE ignore changes all whose lines match RE --strip-trailing-cr strip trailing carriage return on input -a, --text treat all files as text -w, --width=NUM output at most NUM (default 130) print columns -l, --left-column output only the left column of common lines -s, --suppress-common-lines do not output common lines -t, --expand-tabs expand tabs to spaces in output --tabsize=NUM tab stops at every NUM (default 8) print columns -d, --minimal try hard to find a smaller set of changes -H, --speed-large-files assume large files, many scattered small changes --diff-program=PROGRAM use PROGRAM to compare files --help display this help and exit -v, --version output version information and exit If a FILE is '-', read standard input. Exit status is 0 if inputs are the same, 1 if different, 2 if trouble. AUTHOR
Written by Thomas Lord. REPORTING BUGS
Report bugs to: bug-diffutils@gnu.org GNU diffutils home page: <http://www.gnu.org/software/diffutils/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
cmp(1), diff(1), diff3(1) The full documentation for sdiff is maintained as a Texinfo manual. If the info and sdiff programs are properly installed at your site, the command info sdiff should give you access to the complete manual. diffutils 3.6 May 2017 SDIFF(1)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy