From f4e74e4cb00f7e1da77e21be9fec596ae49911f7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 4 Oct 2018 23:24:29 -0700 Subject: [PATCH] First run of torrents. --- README.md | 2 +- add_torrents.sh | 2 ++ find.sh => search.sh | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) rename find.sh => search.sh (81%) 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)