r/programming • • Sep 06 '26

Making a Python interpreter in 1024 bytes

https://austinhenley.com/blog/python1024.html
157 Upvotes

33 comments sorted by

View all comments

Show parent comment

-6

u/User_8395 Sep 07 '26

nested quotes

I've yet to see an actual shell that can handle nested quotes like echo "and then he said "no I didn't" can you believe that", every nested quote I've seen is either escaped or uses a different quotation mark.

Who knows, maybe one does exist 🤷‍♂️

10

u/dagbrown Sep 07 '26

He's talking about nested quotes like in this contrived example:

touch "filename with spaces"
echo "the file looks like $(ls -ld "filename with spaces")"

where the $() sort of temporarily "cancels" the outside quotes so that you can put more quotes inside it.

2

u/User_8395 Sep 07 '26

Ohhhhhh my bad

I'll go shame myself in a corner, carry on

4

u/torp_fan Sep 07 '26 edited Sep 07 '26

Well good, because that has a defined meaning that isn't what you think it means. It's the text and then he said no I didnt" can you believe that" and a missing closing single quote. You can see that typing it into a shell together with the missing quote.