aboutsummaryrefslogtreecommitdiff
path: root/tgsend
diff options
context:
space:
mode:
authorGuillermo Ramos2019-06-25 14:50:45 +0200
committerGuillermo Ramos2019-06-25 14:50:45 +0200
commit71d0f097da4f35823116c1a89f0c55d2c5adbc74 (patch)
tree833861d3ea7ba9afcd36f3f02b850b2ddf69aeb5 /tgsend
parent5cd9d90a7fa86dc42b38d900b3ab4482f1f8ad59 (diff)
downloadtgutils-71d0f097da4f35823116c1a89f0c55d2c5adbc74.tar.gz
Trim tgsend input
Diffstat (limited to 'tgsend')
-rwxr-xr-xtgsend3
1 files changed, 2 insertions, 1 deletions
diff --git a/tgsend b/tgsend
index 9a77feb..6bacc2e 100755
--- a/tgsend
+++ b/tgsend
@@ -40,7 +40,8 @@ $TOKEN ||= fetch_token() or
# Read text from stdin
undef $/;
-my $text = <STDIN>;
+my $text = join "", <STDIN>;
+$text =~ s/^\s+|\s+$//g; # Trim input
# Send message to chats (or pretend to)
if ($PRETEND) {