Advertisement
tei123

Untitled

Jan 9th, 2019
3,963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.77 KB | None | 0 0
  1. awk 'BEGIN{print "#include <stdio.h>\n#include <time.h>\n#include <stdlib.h>\nint main(){"}{print} END{print "}"}{print}' pascal.pas>output2.txt
  2.  
  3. awk '
  4. {gsub(/writeln/,"printf");
  5. gsub(/var/,"int");
  6. gsub(/: integer/," ");
  7. gsub(/: randomize/,"srand(time(NULL))");
  8. gsub(/:=random/,"=rand");
  9. gsub(/\047/,"\"");
  10. gsub(/begin/," ");print}'
  11.  
  12. pascal.pas>output2.txt
  13.  
  14. awk 'BEGIN{print "}"}{print}' pascal.pas>output2.txt
  15.  
  16. awk ' {gsub(/writeln/,"printf");gsub(/\047/,"\"");gsub(/:=random\(20\)/,"=rand()%20");gsub(/var/,"int");gsub(/randomize/,"srand(time(NULL))");gsub(/: integer/," ");gsub(/begin/," ");print}' pascal.pas>output2.txt
  17.  
  18.  
  19. awk 'BEGIN{print "#include <stdio.h>\n#include <time.h>\n#include <stdlib.h>\nint main(){"}{print} END{print "}"}' output2.txt>output3.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement