grep portable

This commit is contained in:
Luke Smith 2019-04-26 11:20:26 -04:00
parent 8bf5ef31fc
commit 7caf7ca90e
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252

14
bin/mw
View File

@ -204,13 +204,13 @@ finalize() { \
echo "mailboxes =$title ===================== $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc" echo "mailboxes =$title ===================== $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc"
printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n" printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n"
sed -i "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc" sed -i "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc"
echo "$boxes" | grep -i -m 1 inbox | formatShortcut i inbox echo "$boxes" | grep -i inbox | head -n 1 | formatShortcut i inbox
echo "$boxes" | grep -i -m 1 sent | formatShortcut s sent echo "$boxes" | grep -i sent | head -n 1 | formatShortcut s sent
echo "$boxes" | grep -i -m 1 draft | formatShortcut d drafts echo "$boxes" | grep -i draft | head -n 1 | formatShortcut d drafts
echo "$boxes" | grep -i -m 1 trash | formatShortcut t trash echo "$boxes" | grep -i trash | head -n 1 | formatShortcut t trash
echo "$boxes" | grep -i -m 1 spam | formatShortcut S spam echo "$boxes" | grep -i spam | head -n 1 | formatShortcut S spam
echo "$boxes" | grep -i -m 1 junk | formatShortcut j junk echo "$boxes" | grep -i junk | head -n 1 | formatShortcut j junk
echo "$boxes" | grep -i -m 1 archive | formatShortcut a archive echo "$boxes" | grep -i archive | head -n 1 | formatShortcut a archive
[ "$accounttype" = "offline" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title" [ "$accounttype" = "offline" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title"
return 0 return 0
} }