2.1.3 Reading URLs From File

It is sometimes convenient to send a collection of URLs to Pinboard from file. For instance, the One Tab Firefox plugin allows the user to export saved links to a plain text file in the format “URL | Title”. One can invoke pin on the contents of that file in one fell swoop like so:

cat links.txt|tr '\n' '\0'|xargs -0 pin send -I -r my-target

The input file may contain blank lines. In that case, it is convenient to supply the -I option (or --ignore-blank); in this case pin will simply ignore empty arguments, rather than producing an error message & halting.