diff --git a/README.md b/README.md index f9f7626..94f44ee 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An *upload*, consists of making a pull request after running the `add_torrents.sh` script that adds your new unique torrents to the file, after checking that they aren't already there, and that they have seeders. -To find torrents run `./find.sh "SEARCH"` +To find torrents run `./search.sh "SEARCH"` To contribute: - [Click here](https://gitlab.com/dessalines/torrents.csv/forks/new) to fork this repo. diff --git a/add_torrents.sh b/add_torrents.sh index 168c146..bd33478 100755 --- a/add_torrents.sh +++ b/add_torrents.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Checking arguments # Help line torrents_csv="`pwd`/torrents.csv" diff --git a/find.sh b/search.sh similarity index 81% rename from find.sh rename to search.sh index f7318ed..e9eaff1 100755 --- a/find.sh +++ b/search.sh @@ -1,6 +1,7 @@ torrent_csv_file="`pwd`/torrents.csv" -search=$(grep -i "$1" $torrent_csv_file) +search_string=${1// /.*} # turn multiple string regexes into i.*am.*spartacus +search=$(grep -i "$search_string" $torrent_csv_file) # Sort results by seeders search=$(echo -e "$search" | sort --field-separator=';' --key=5 -g)