help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dollars expansion in Eshell


From: Xue Fuqiao
Subject: Dollars expansion in Eshell
Date: Wed, 31 Jul 2013 09:08:51 +0800

Hi,

I'm learning the dollars expansion of Eshell now.  In (info "(eshell)
Dollars Expansion"):

  `$var[i]'
     Expands to the `i'th element of the value bound to `var'.  If the
     value is a string, it will be split at whitespace to make it a
     list.  Again, raises an error if the value is not a sequence.

I typed `M-: (setq str "ls date info") ⏎', then entered Eshell:

--8<---------------cut here---------------start------------->8---
~ $ $str
ls date info: command not found
--8<---------------cut here---------------end--------------->8---

Right.  But:

--8<---------------cut here---------------end--------------->8---
~ $ $str[0]
nil: command not found
~ $ $str[1]
nil: command not found
--8<---------------cut here---------------end--------------->8---

Why nil?  I must have got something wrong.  Can anyone point me in the
right direction?

-- 
Best regards, Xue Fuqiao.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]