Skip to content

Instantly share code, notes, and snippets.

@kou029w
Created January 18, 2017 11:23
Show Gist options
  • Save kou029w/5ed4c9bf21e1c8a2fc522aa2c571122c to your computer and use it in GitHub Desktop.
Save kou029w/5ed4c9bf21e1c8a2fc522aa2c571122c to your computer and use it in GitHub Desktop.
stdin2factor.sh
#!/bin/bash
# while read i; do
# scr=`echo $i \
# | grep -oE [0-9]+ \
# | factor \
# | sed 's/ //;
# s/ /x/g;
# s/.*/s:&:;/'`
# echo $i \
# | sed "$src"
# done
while read i;do sed "`grep -oE [0-9]+<<<$i|factor|sed 's/ //;s/ /x/g;s/.*/s:&:;/'`"<<<$i;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment