Skip to content

Instantly share code, notes, and snippets.

@goedel-gang
Last active June 30, 2019 12:02
Show Gist options
  • Save goedel-gang/d90b37b1f760ecaf54f4c61295b76d7f to your computer and use it in GitHub Desktop.
Save goedel-gang/d90b37b1f760ecaf54f4c61295b76d7f to your computer and use it in GitHub Desktop.
#!/bin/bash
# https://unix.stackexchange.com/a/527714/347199
mkfifo mypipe
trap 'rm -f mypipe' EXIT
printf '%d\n%d\n' 0 1 >mypipe &
python3 -c '
number_phile = open(3, "w")
n = 50
b = int(input())
for _ in range(n):
a, b = b, int(input())
print(a + b, file=number_phile, flush=True)
print("F_{} = {}".format(n, b))' <mypipe 3>mypipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment