Skip to content

Instantly share code, notes, and snippets.

@xboxone08
Last active April 18, 2023 17:52
Show Gist options
  • Save xboxone08/fef5170653a897a5deae7692aa084055 to your computer and use it in GitHub Desktop.
Save xboxone08/fef5170653a897a5deae7692aa084055 to your computer and use it in GitHub Desktop.
Command to pretty-print Windows %PATH% using Batchfile and Python
python -c "from sys import argv; print(''.join(argv[1:]).replace(';', '\n'))" %PATH%
@xboxone08
Copy link
Author

xboxone08 commented Apr 18, 2023

python -c Run the following command in Python.
''.join(argv[1:]) Takes all the following arguments and puts them into one string.
.replace(';', '\n') Takes that string and replaces the semicolons with newlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment