From e0c0eec421954badbe5c9d67868b9fe1f368d24a Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 2 May 2015 18:45:11 +0100 Subject: Put curl's arguments into a variable --- title.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'title.bash') diff --git a/title.bash b/title.bash index d1754d9..9bed0c5 100755 --- a/title.bash +++ b/title.bash @@ -13,6 +13,8 @@ : update user agent string # v0.8.1: change name in version string to "blatitle" +OPTS='--location --insecure --silent --max-filesize 1048576 --max-time 10 -A "Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"' + read url if [ "$url" == "-h" ] || [ "$url" == "--help" ] @@ -22,5 +24,5 @@ elif [ "$url" == "-v" ] || [ "$url" == "--version" ] then echo "blatitle version 0.8.1" else - curl --location --insecure --silent --max-filesize 1048576 --max-time 10 -A "Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0" "$url" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!I;tnext};b;:next;s!.*\(.*\).*!\1!pI' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/^[ \t]*//' + curl $OPTS "$url" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!I;tnext};b;:next;s!.*\(.*\).*!\1!pI' | sed ':a;N;$!ba;s/\n//g' | sed -e 's/^[ \t]*//' fi -- cgit v1.2.3