Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
grep command?
#2
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:

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) )
Reply


Messages In This Thread
grep command? - by The Grim Sleeper - 01-20-2018, 11:16 AM
RE: grep command? - by kremlin - 01-20-2018, 11:46 AM
RE: grep command? - by The Grim Sleeper - 01-20-2018, 12:37 PM
RE: grep command? - by kremlin - 01-20-2018, 01:29 PM
RE: grep command? - by The Grim Sleeper - 01-21-2018, 06:32 AM
RE: grep command? - by The Grim Sleeper - 01-21-2018, 09:30 AM
RE: grep command? - by kremlin - 01-21-2018, 09:50 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)