How to execute this brew installed tool ‘gigtools’

bashcommand lineterminal

My goal is to to run this 'gigtools' folder which extracts and converts .gig files into .wav files.

Website: https://command-not-found.com/gigextract

So I've installed the commands with Xcode- and the 'instructions' say this :

SYNOPSIS

    gigextract [ -v ] GIGFILE DESTDIR [SAMPLENR] [ [SAMPLENR] ... ]

I'm not good at basic level coding by any means, but I would love an example string to type into terminal to properly execute this, assuming my .gig files are in my /Downloads folder for reference.

Best Answer

The syntax is:

gigextract [-v] GIGFILE DESTDIR [SAMPLENR] [ [SAMPLENR] ...]

The following would extract the files in Downloads folder.

gigextract "~/Downloads/myfile.gig" "~/Downloads/"

Optionally add indices of samples you get from

gigdump "~/Downloads/myfile.gig"

A bit more help is at gigextract --help


For multiple files, you can use shell loops like

cd ~/Downloads
for g in *.gig; do gigextract "$g" ./; done

or, if you downloaded a whole directory structure of .gig files,

cd ~/Downloads
find . -name '*.gig' -execdir gigextract '{}' ./ \;

A less elegant way is to create a shell script like extract.sh which contains

cd ~/Downloads
gigextract "myfile.gig" ./
gigextract "myfile2.gig" ./

and run it with sh extract.sh