For Reference: bash == .sh ; c == .c ; c++ == .cpp ; clisp == . lsp ; golang == .go ; haskell == .hs perl == .pl ; nodejs == .js ; python == .py ; php == .php ; ruby == .rb ; rust == .rs ; scala == .sh
#!/usr/bin/env python import sys infile = sys.argv with open(infile) as f: do_stuff()
#!/bin/bashc (gcc 7.3.0):
No shebang needed, just name the file ending in .cc++ (g++ 7.3.0):
No shebang needed, just name the file ending in .cppclisp (2.49.60+):
#!/usr/bin/env clispgolang (1.10.2):
No shebang needed, just name the file ending with .gohaskell (8.0.2):
No shebang needed, just name the file ending with .hsperl (5.26.1):
#!/usr/bin/env perlnodejs (10.2.1):
#!/usr/bin/env nodepython (2.7.15):
#!/usr/bin/env pythonpython3 (3.6.5):
#!/usr/bin/env python3php (7.2.5):
#!/usr/bin/env rubyrust 1.26.0 (a77568041 2018-05-07)
No shebang needed, just name the file ending with .rsscala (2.11.12):
diff -yW"`tput cols`" expected_output.txt my_solve_output.txtWhitespace at the end of your output does not matter. All output (both yours, and the expected) are run through .strip() prior to comparison. If your output ends with 'ohai\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' it will be compared as 'ohai'.
sudo apt-get install wamericanWhich will install that same file into /usr/share/dict/american-english.
$ ./solve.py input_data1.txt | python -c "import sys,hashlib; print(hashlib.sha1(sys.stdin.read().strip()).hexdigest())"
echo -en "this is a line\nthis is another line\nthis is the lastline" > test_file.txtthen try
echo -e "this is a line\nthis is another line\nthis is the lastline" > test_file.txtyou will get different results. Please plan to read your data against input built with the first example.