User: Password:
Subscribe / Log in / New account

Removing the quote distinction?

Removing the quote distinction?

Posted May 19, 2005 17:44 UTC (Thu) by smeg4brains (guest, #207)
In reply to: Removing the quote distinction? by liljencrantz
Parent article: Fish - The friendly interactive shell

Yeah.. the language seems pretty nice, but I do have to agree with people that the quotes should be handled differently..

Maybe keep the difference in the quotes as usual, but steal python's
''' , '' , '
""" , "" , "

All of the single quote variations could skip the variable expansion, but all of the double quote versions could expand variables..

This way you can keep some of the backward compatibility with bash/sh, but you also have cleaner/better quote mechanisms as well..


echo """Hello $USER

Welcome to "".
All connections logged."""

echo '''To add to your $PATH variable, use something like:
export PATH="$PATH:/home/jeffb/.bin/" '''

(Log in to post comments)

Removing the quote distinction?

Posted May 19, 2005 23:20 UTC (Thu) by liljencrantz (guest, #28458) [Link]

Yes, using something like Pythons one, two or three quotes is an option. It means that quotes can be nested, while also allowing different kinds of quotes.

I think I'll wait for a while and see if the screams for more quoting options die out. I'd rater keep the language small. Also, I'm kind of lazy.

Removing the quote distinction?

Posted Mar 9, 2008 20:30 UTC (Sun) by Mysingen (guest, #50982) [Link]

Why not just escape the variables instead?

set a Hello
set b '\$a is $a'
set a Goodbye
echo $b

should print "$a is Hello"

It is just a hassle to keep track of what will be expanded in bash scripts and I would really
like the distinction between ' and " to go away.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds