Y
Hacker News
new
|
ask
|
show
|
jobs
by
porridgeraisin
430 days ago
python3 -m http.server "${$1:-8080}" "${$2:-.}"
1 comments
Y_Y
429 days ago
Almost! That will read the variable whose
name
is is the script argument. Also the directory argument needs a flag on my setup. It should be:
python3 -mhttp.server "${1:-8080}" -d "${2:-.}"
link
porridgeraisin
429 days ago
Yep, you're right.
link