Code Monkey home page Code Monkey logo

s-checker's People

Contributors

albertaparicio avatar klanz avatar

Watchers

 avatar  avatar

Forkers

kevinyang007

s-checker's Issues

Fix "unary operator expected" and "sha1sum: XX: No such file or directory" errors

When inputing S Checker a file with spaces in its name, these errors pop up.

An example of an execution with the -x argument in bash:

bash -x ~/bin/s_checker -s1 -f 05\ Symphonies\ Of\ The\ Planets\ 5.m4a -c 80c0c0f6266fa94c46344faa9f3f672b57a2b01c
+ copyright_notice='schecker (S Checker) v1.2 ©Copyright (C) 2015-2016 Albert Aparicio'
+ mode=
+ checksum=
+ filename=
+ device=
+ '[' 5 -eq 0 ']'
+ '[' -s1 '!=' '' ']'
+ case $1 in
+ mode=SHA1
+ shift
+ '[' -f '!=' '' ']'
+ case $1 in
+ shift
+ filename='05 Symphonies Of The Planets 5.m4a'
+ shift
+ '[' -c '!=' '' ']'
+ case $1 in
+ shift
+ checksum=80c0c0f6266fa94c46344faa9f3f672b57a2b01c
+ shift
+ '[' '' '!=' '' ']'
+ echo ''

+ case $mode in
+ show_data
+ clear

+ echo '███████╗     ██████╗██╗  ██╗███████╗ ██████╗██╗  ██╗███████╗██████╗ 
██╔════╝    ██╔════╝██║  ██║██╔════╝██╔════╝██║ ██╔╝██╔════╝██╔══██╗
███████╗    ██║     ███████║█████╗  ██║     █████╔╝ █████╗  ██████╔╝
╚════██║    ██║     ██╔══██║██╔══╝  ██║     ██╔═██╗ ██╔══╝  ██╔══██╗
███████║    ╚██████╗██║  ██║███████╗╚██████╗██║  ██╗███████╗██║  ██║
╚══════╝     ╚═════╝╚═╝  ╚═╝╚══════╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝
                                                                    '
███████╗     ██████╗██╗  ██╗███████╗ ██████╗██╗  ██╗███████╗██████╗ 
██╔════╝    ██╔════╝██║  ██║██╔════╝██╔════╝██║ ██╔╝██╔════╝██╔══██╗
███████╗    ██║     ███████║█████╗  ██║     █████╔╝ █████╗  ██████╔╝
╚════██║    ██║     ██╔══██║██╔══╝  ██║     ██╔═██╗ ██╔══╝  ██╔══██╗
███████║    ╚██████╗██║  ██║███████╗╚██████╗██║  ██╗███████╗██║  ██║
╚══════╝     ╚═════╝╚═╝  ╚═╝╚══════╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝

+ echo schecker '(S' 'Checker)' v1.2 ©Copyright '(C)' 2015-2016 Albert Aparicio
schecker (S Checker) v1.2 ©Copyright (C) 2015-2016 Albert Aparicio
+ sum_data
+ echo '
Mode: Checksum checking

Algorithm: SHA1
File: 05 Symphonies Of The Planets 5.m4a
Checksum: 80c0c0f6266fa94c46344faa9f3f672b57a2b01c

Computing checksum...
'

Mode: Checksum checking

Algorithm: SHA1
File: 05 Symphonies Of The Planets 5.m4a
Checksum: 80c0c0f6266fa94c46344faa9f3f672b57a2b01c

Computing checksum...

+ compute_sum sha1sum
+ algorithm=sha1sum
++ sha1sum 05 Symphonies Of The Planets 5.m4a
++ cut -d ' ' -f 1
sha1sum: 05: No such file or directory
sha1sum: Symphonies: No such file or directory
sha1sum: Of: No such file or directory
sha1sum: The: No such file or directory
sha1sum: Planets: No such file or directory
sha1sum: 5.m4a: No such file or directory
+ '[' = 80c0c0f6266fa94c46344faa9f3f672b57a2b01c ']'
/home/albert/bin/s_checker: line 73: [: =: unary operator expected
+ echo '!!--Checksum Mismatch--!!'
!!--Checksum Mismatch--!!
+ exit 0

Compare two folders or lists of files

The idea of this is to wrap the ability of md5sum or shasum to check several files against a CHECKSUMS list.

It would also be nice to be able to check several files against several other files, say, a whole directory.

It will need to be determined if each file will be checked against each other file, or just compare the ones that have the same file name.

Merge 2 directories

The idea is to take a directory, and copy or move its files into another one, replacing files only if the ones to be copied have been modified relative to the ones to be replaced. The files that are not in the target directory would be copied directly.

Check a file against another file

This new feature consists in making S Checker able to compare two files and see if they are identical.

Filenames are not an issue to be concerned about, since two identical files with different names can have the same hash.

Check for the needed checksum computation software

To ensure the proper execution of S Checker, there is some software that needs to be installed on the system:

  • Bash interpreter
  • GNU/Linux core system utilities (cut, cmp, etc.)
  • md5sum
  • sha1sum
  • sha256sum
  • sha512sum

Before any operation takes place, S Checker should check that all this software is installed in the system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.