01-20-2018, 11:46 AM
(This post was last modified: 01-20-2018, 01:25 PM by kremlin. Edited 3 times in total.)
i think this is reasonable if we think up another acronym for grep as a whole regex parser is overkill. this grep would take 2 params, a string & a filename, and print lines in that file that contain the string exactly like grep just without metacharacters.
i grepped for grep:
i grepped for grep:
Code:
esmeralda:code kremlin$ pwd
/Users/kremlin/code/goonstation-2016/code
esmeralda:code kremlin$ find . -name '*.dm' | xargs grep grep
./obj/item/device/pda2/pda2.dm: var/datum/signal/pingreply = new
./obj/item/device/pda2/pda2.dm: pingreply.source = src
./obj/item/device/pda2/pda2.dm: pingreply.data["device"] = "NET_PDA_51XX"
./obj/item/device/pda2/pda2.dm: pingreply.data["netid"] = src.net_id
./obj/item/device/pda2/pda2.dm: pingreply.data["address_1"] = signal.data["sender"]
./obj/item/device/pda2/pda2.dm: pingreply.data["command"] = "ping_reply"
./obj/item/device/pda2/pda2.dm: pingreply.data["data"] = src.owner
./obj/item/device/pda2/pda2.dm: src.post_signal(pingreply)
./obj/machinery/vending.dm: product_list += new/datum/data/vending_product("/obj/item/mechanics/regreplace", 30)
./WorkInProgress/MechanicMadness.dm:/obj/item/mechanics/regreplace
./WorkInProgress/MechanicMadness.dm: icon_state = "comp_regrep"
./WorkInProgress/MechanicMadness.dm: icon_state = "[under_floor ? "u":""]comp_regrep"
./WorkInProgress/computer3/mainframe2/utilities.dm://grep Regexes and stuff. idk. nerds
./WorkInProgress/computer3/mainframe2/utilities.dm:/datum/computer/file/mainframe_program/utility/grep
./WorkInProgress/computer3/mainframe2/utilities.dm: name = "grep"
./WorkInProgress/computer3/mainframe2/tapes.dm: //newfolder.add_file( new /datum/computer/file/mainframe_program/utility/grep(src) )
./WorkInProgress/computer3/mainframe2/tapes.dm: //src.root.add_file( new /datum/computer/file/mainframe_program/utility/grep(src) )