[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Split string into shell words?
From: |
Stefan Monnier |
Subject: |
Re: Split string into shell words? |
Date: |
Tue, 20 Jan 2004 18:04:47 GMT |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> Given a string as in the following line:
> foo "a b" 'c d' e\ f bar
> I'd like a function that returns the following list:
> ("foo" "a b" "c d" "e f" "bar")
> That is, the string should be split into words like a shell would
> split it into words.
> I thought there must be a function in comint*.el or shell*.el
> somewhere, but couldn't find it. Probably I'm blind.
It's pretty nasty to do it right:
foo "bar $(baz "toto") titi"
should turn into "foo" "bar $(baz \"toto\") titi".
What do you need this for ?
Stefan