clemmy/utils.sh

23 lines
310 B
Bash
Raw Normal View History

2023-01-17 01:07:40 +11:00
#Utils
2023-01-17 03:30:28 +11:00
getbody()
{
echo "Write your comment, press ctrl+d on a blank line to submit"
a=$(cat)
while read n; do
b="$b\n$n"
done <<< "$a"
c=${b//\"/\\\"}
body="${c:2}"
}
namedget()
{
2023-04-25 03:25:22 +10:00
echo $2:
2023-01-17 03:30:28 +11:00
if [ $3 ]; then
echo "(Press ctrl+d on a blank line to submit)"
read $1 <<< $(cat)
else
read $1
fi
}