/swordx

App that lets you count occurrences of words inside files.

Primary LanguageCGNU Affero General Public License v3.0AGPL-3.0

SwordX

Copyright © Michele Biondi, Samuele Cucchi

This is the repository for the project of Operating Systems lab at University of Camerino, Italy.

SwordX is a command line tool to count word occurences inside of files.

Installation

Inside program folder

make
make install # as root

You should be able to use the 'swordx' command from anywhere.

As an alternative you can build files using Docker, the steps become (run as root):

# make sure to remove old compiled files

./build_docker.sh
make install

Using docker

You can also run swordx from the official container:

docker run --rm -v $TARGET_FOLDER:/files -v $OUTPUT_FOLDER:/output an4cr0n/swordx:latest [options] 

Remove

To remove the program just run as root inside program folder

make uninstall

Usage

To list all options run:

swordx --help

By default the program will save results in a file called 'swordx.out' inside current folder.

Examples

Read words from file sample.txt and sample2.txt

swordx sample.txt sample2.txt

Read words from folder samples and write results to 'output.txt' and sort results by occurences

swordx sample/ -s -o output.txt

Development

To run tests you need the cunit framework, on debian based systems you need to run as root:

apt-get update
apt-get install libcunit1 libcunit1-dev

Next you can run tests using:

make # if you didn't run it previously
make test