Create a program which accepts a string on stdin, and outputs to stdout either the string ``tsk'', or an empty string. The formar case happens when the input string contains the substring ``nigger'' (case-insensitive). The latter happens in other cases.
Shortest program wins. You have 7*24 hours from the timestamp of this poast. Good luck!
Would specifying flags for the program be cheating? If you do sed -n, you can do s/nigger/tsk/ip otherwise I need to add two characters more s/nigger/tsk/ip;d This requires GNU sed.
Name:
Anonymous2022-04-16 6:15
>>7 you can use any flags, but they add to the byte count
>>9 All nonstandard includes and imports are counted towards the bytecount. void dot h is nonstandard.
Name:
Anonymous2022-04-18 0:10
while read line; do if echo "$line" | grep -i "hello"; then echo "world"; else echo; fi; done
Name:
Anonymous2022-04-18 0:20
nlsh> take input from stdin if string 'hello' is entered replace with 'world' otherwise print nothing >>> Run: while read line; do if echo "$line" | grep -q "hello"; then echo "world"; else echo "$line"; fi; done [Y/n]: Y aff aff hello world ^Cnlsh> no i mean print out empty string if something else >>> Run: while read line; do if echo "$line" | grep -q "hello"; then echo "world"; else echo; fi; done [Y/n]: Y hello world foajfoa
^Cnlsh> make it case insensitive >>> Run: while read line; do if echo "$line" | grep -i "hello"; then echo "world"; else echo; fi; done [Y/n]: Y
Name:
Anonymous2022-04-18 3:39
>>12 WAA WAAA WAAA SHRDLU NO LIKE WAAAH WAAH WAAAH