[{"data":1,"prerenderedAt":228},["ShallowReactive",2],{"project-12320461":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":38,"post_text":41,"what":42,"said":59,"maker_in_thread":150,"shape":153,"grid":155,"attempts":191,"same_week":192,"maker_shows":33,"maker_hidden":221,"reader_version":222,"card":223},"12320461","Replify","Create a REPL for any command","title","Show HN: Replify – Create a REPL for any command","https:\u002F\u002Fgist.github.com\u002Fdanielrw7\u002Fbb88e3dad565c0d8ee54031f6b758a09","gist.github.com","danielrw7",1471618711,2016,112,18,324,2264,15,"notable","dev_tools","shell scripting","cli",[24,25,26,27],"repl","shell","bash","command line","mixed",0,{"positive":31,"neutral":32,"mixed":33,"critical":31},2,4,1,9,{"idea":36,"design":37},{"positive":31,"critical":31},{"positive":29,"critical":29},[33,39,39,29,33,39,29,29,29,29,29,29,39,39,29,29,40,40],3,5,null,{"problem":43,"audience":41,"pricing":41,"motivation":41,"time_to_build":41,"stack":53,"openness":58,"stage":58,"team_size":58},{"value":44,"source":45,"evidence":46},"Running a command repeatedly with different arguments without retyping the command name","inferred",[47,49],{"id":48},"post",{"id":50,"by":51,"text":52},"12322035","kazinator","Here is my version: ``` #!\u002Fbin\u002Fbash printf \"REPL for %s\\n\" \"$@\" notblank() { [ $# -gt 0 ] } while true ; do printf \"%s> \" \"$@\" read -r || break; notblank $REPLY || continue; eval…",[54],{"value":26,"source":55,"evidence":56},"commenter",[57],{"id":50,"by":51,"text":52},"unknown",{"praise":60,"objections":79,"requests":95,"questions":115,"alternatives":116},[61,72],{"value":62,"source":55,"evidence":63},"Cool and neat trick",[64,68],{"id":65,"by":66,"text":67},"12320481","AlphaWeaver","This is pretty cool!",{"id":69,"by":70,"text":71},"12321600","seibelj","Neat trick - the only change I made is to exit the while loop by typing \"exit\". That way the enter key runs the command with no arguments, and you can exit with control+c or by…",{"value":73,"source":55,"evidence":74},"Could enhance Docker CLI experience",[75],{"id":76,"by":77,"text":78},"12325447","vitoc","This could significantly enhance my Docker in the CLI user experience.",[80,84,88],{"value":81,"source":55,"evidence":82},"Not very useful without history and related features",[83],{"id":50,"by":51,"text":52},{"value":85,"source":55,"evidence":86},"Should be a Bash feature rather than a standalone script",[87],{"id":50,"by":51,"text":52},{"value":89,"source":55,"evidence":90},"Ruby or other languages are better suited for growing feature sets",[91],{"id":92,"by":93,"text":94},"12322537","jbbarth","It's likely that with the feature set growing, a version that uses a slightly more advanced language would be easier to maintain and have less \"traps\" than the bash version...",[96,104,111],{"value":97,"source":55,"evidence":98},"Add command history and readline-style features",[99,100],{"id":50,"by":51,"text":52},{"id":101,"by":102,"text":103},"12322989","tlrobinson","Related: rlwrap adds some of readline's features like history to REPLs that don't have those things out of the box.",{"value":105,"source":55,"evidence":106},"Store previous results in variables",[107],{"id":108,"by":109,"text":110},"12321818","continuational","It's only a REPL in the most trivial sense if it doesn't remember variables or results between commands. I suppose it would be easy to store the output in $LAST or $R1, $R2, ...,…",{"value":112,"source":55,"evidence":113},"Exit with a word instead of an empty line",[114],{"id":69,"by":70,"text":71},[],[117,129,136,143],{"value":118,"source":55,"evidence":119},"rlwrap",[120,124,128],{"id":121,"by":122,"text":123},"12322677","mateuszf","Maybe using rlwrap command would help with the autocompletion and history?",{"id":125,"by":126,"text":127},"12322736","Jtsummers","https:\u002F\u002Fgithub.com\u002Fhanslub42\u002Frlwrap EDIT: beat to the punch, should've refreshed.",{"id":101,"by":102,"text":103},{"value":130,"source":131,"evidence":132},"With (mchav\u002FWith)","maker",[133],{"id":134,"by":11,"text":135},"12320554","I just found out about a very similar command [1] that has more features. [1] https:\u002F\u002Fgithub.com\u002Fmchav\u002FWith",{"value":137,"source":55,"evidence":138},"defunkt\u002Frepl (Ruby)",[139],{"id":140,"by":141,"text":142},"12321839","unfletch","Another generic `repl` utility, this one in ruby: https:\u002F\u002Fgithub.com\u002Fdefunkt\u002Frepl",{"value":144,"source":55,"evidence":145},"shrepl (POSIX shell port)",[146],{"id":147,"by":148,"text":149},"12322362","joh6nn","i actually ported this over to POSIX shell a few years back: https:\u002F\u002Fgithub.com\u002Fjoh6nn\u002Fshrepl afaik, it will work just about anywhere you can invoke a shell (i haven't tested it…",{"comments":33,"answered":29,"key":151},[152],{"id":134,"text":135},{"commenters":154,"max_depth":40,"maker_replies":33,"first_comment_mins":31,"lifespan_hours":18},14,[156,158,160,161,162,163,164,168,170,172,174,175,177,178,180,184,186,189],[50,29,33,157,51,29],"project\u002Fcritical\u002Fidea",[121,29,39,159,122,29],"project\u002Fneutral\u002Fidea",[125,29,39,159,126,29],[134,33,29,159,11,33],[108,31,33,157,109,29],[140,39,39,159,141,29],[165,39,29,166,167,29],"12321966","commenter\u002Fneutral\u002Fnone","Sir_Cmpwn",[169,39,29,166,93,29],"12322058",[171,39,29,166,167,29],"12322158",[173,39,29,166,148,29],"12322498",[92,39,29,166,93,29],[147,39,29,176,148,29],"other\u002Fneutral\u002Fnone",[101,32,39,159,102,29],[69,40,39,179,70,29],"project\u002Fmixed\u002Fdesign",[181,40,29,182,183,29],"12322854","commenter\u002Fneutral\u002Fdesign","Bino",[185,40,29,182,70,29],"12325350",[65,187,40,188,66,29],6,"project\u002Fpositive\u002Fidea",[76,190,40,188,77,29],7,[],[193,197,202,206,211,216],{"id":194,"name":195,"points":196,"category":20},"12355102","Carbide",628,{"id":198,"name":199,"points":200,"category":201},"12319661","posio",220,"games",{"id":203,"name":204,"points":205,"category":20},"12342781","Workq",185,{"id":207,"name":208,"points":209,"category":210},"12312196","WebGL Fire Simulation",143,"creative",{"id":212,"name":213,"points":214,"category":215},"12311930","save-as-ebook",106,"productivity",{"id":217,"name":218,"points":219,"category":220},"12331915","Cryptic",93,"security_privacy",false,"v2",{"id":224,"name":5,"line":6,"ai":221,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":225,"maker":11,"domain":10,"tier":19,"attempts":29,"strip":226,"url":9,"mix":227,"praise":62,"objection":81,"sub":21},12320461,[24,25,26,27],"133013000000330055",[31,32,33,31],1794036546879]