I would use comm, sort, find to compare file lists of each subtree, sed to separate the both from the a only and b only lists for futher processing or reporting, and cmp to decide if the both files differ:
LC_ALL=C ensures a binary sort for comm. Diff is for humans, mostly. Bash, or ksh on /dev/fd/# systems, to get the <().
Sorry, need more robust effort; use quotes around $f, like
Since the whole is already in double quotes, a single quote does not upset that quoting and it does not prevent expanding $f, since the single quote, in double quotes, is a literal for itself, not a live quote, yet. The expanded $f is in single quotes, so spaces are OK unless it gets passed through some shell again not properly quoted. For instance, a shell script should accept parameters as "$1" not barefoot, in case of meta-characters.
Now, if you have a file with a quote character in the name, anothe flavor of dealing with it is to convert anymets-characterslike space and quote into '?', a wild card for a single character but otherwise not a space or quote. In this case, just stick a '| tr ' ' '?' " before the "| while read " and all the spaces become '?'. Just make sure that the last use of it is barefoot so the shell can expand it and virtually quote it as $1 or whatever to the C program. In actuality, by that time it is converted to a null terminated string pointed to by some member of the argv[] array of character pointers. Quoting become start here and null terminate there in machine language. The C open() call and such can deal with the embedded spaces just fine, it is the shell that divides it into two or more arguments when it finds a $IFS character.
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Hi,
I've noticed that the permissions output from "ls -l" under SunOS differs from Linux in that after the "rwxrwxrwx" field, there is an additional "+" character that may or may not be there. What is the significance of this character?
Thanks,
Suan (6 Replies)
dear members,
I am having some difficulties with an automation script that I am writing.
We have equipments deployed over our network that generate status messages and I was trying an automated method to collect all information.
I did a expect script that telnet all devices, logs, asks for... (4 Replies)
Hi All,
I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel).
For my application:
<sar -U ALL>
CPU %user %nice %system %idle
...
10:58:04 0 153.10 0.00 38.76 0.00
10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
I have a c-source file that is evidently seen by unix as a binary file. When doing a diff between it and older versions with substantial differences, diff will only return "files differ".
I have tried cat-ing the file to another file; tried using the "-h" on the diff; I have tried ftp-ing it... (7 Replies)
Hi all,
I use the diff command and got the output:
$> diff -e file1.txt file2.txt
15a
000675695 Yi Chen Chen 200520 EASY 50 2/28/05 0:00 SCAD Debit Card Charge
.
12a
000731176 Sarah Anderson 200520 EASY 25 2/28/05 0:00 SCAD Debit Card Charge
.
11a... (5 Replies)