Jump to content

Single quotes messing up workflow


philipmorgan

Recommended Posts

I'm trying to modify the AppendText2File workflow so that if the text to be appended has a single quote inside it the workflow doesn't break.

 

Here's the relevant portion of the workflow:

dt=`date` 
## append to the original file
echo "* "$dt" -- "{query} >> $original

What do I do to strip out single quotes (or replace them with something bash/Alfred doesn't hate)?

Link to post

A possible solution (haven’t looked into the workflow itself) would be to surround {query} itself in double quotes (single quotes will have no effect there), and espace the options that could be problematic.

D4MtpDq.png

 

dt="$(date)"
## append to the original file
echo "* ${dt} -- {query}" >> "${original}"
Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...