lftp

From
Vanya Matveev (2:5030/1243.3)
To
Igor Mitichev
Date
2006-01-13T14:16:34Z
Area
RU.UNIX.FTN
Здравствуйте Igor,

11 Jan 06 19:01, Igor Mitichev wrote to Oleg Lobachev:

 IM> Hello Oleg.

 IM> 11 Янв 06 18:42, I wrote to you:

 IM>>>> переменные среды. Если вместо $ZNL прописать имя файла явно, то
 IM>>>> все работает как
 OL>>> `echo $ZNL`?
 IM>> put: /var/fido/nodelist/`echo: No such file or directory
 IM>> put: /var/fido/nodelist/$ZNL`: No such file or directory

 IM> Что интересно, для решения проблемы почему-то оказалось достаточно в
 IM> строке:

 IM> /usr/bin/lftp -c 'open -u user,password
 IM> 192.168.12.2/var/www/fido/nodelist && put -E $ZNL'

 IM> заменить одинарные кавычки на двойные.

RTFM
man bash
[...]
QUOTING
       Quoting  is  used to remove the special meaning of certain
       characters or words to the shell.  Quoting can be used  to
       disable  special treatment for special characters, to pre-
       vent reserved words from being recognized as such, and  to
       prevent parameter expansion.
[...]
       There  are three quoting mechanisms: the escape character,
       single quotes, and double quotes.
[...]
       Enclosing characters in single quotes preserves  the  lit-
       eral  value of each character within the quotes.  A single
       quote may not occur between single quotes, even when  pre-
       ceded by a backslash.

       Enclosing  characters  in double quotes preserves the lit-
       eral value of all characters within the quotes,  with  the
       exception  of  $, `, and \.  The characters $ and ` retain
       their special meaning within double quotes.  The backslash
       retains  its  special meaning only when followed by one of
       the following characters: $, `, ",  \,  or  <newline>.   A
       double quote may be quoted within double quotes by preced-
       ing it with a backslash.


With best regards
Vanya Matveev

---
 * Origin:  (2:5030/1243.3)  (2:5030/1243.3)
SEEN-BY: 46/50 50/12 203 400/814 450/186 1024 451/30 454/9 465/285 469/418
SEEN-BY: 4646/15 5000/5000 5001/5001 5002/50 79 5003/57 5010/53 5011/13
SEEN-BY: 5012/23 46 5015/10 28 221 5019/31 5020/154 175 400 545 639 715 758
SEEN-BY: 5020/830 937 1523 1604 2020 2142 2238 2871 4441 5021/29 5022/128
SEEN-BY: 5025/3 750 5026/45 5027/12 5030/49 115 436 556 861 966 1045 1063 1067
SEEN-BY: 5030/1080 1210 1231 1243 1368 1451 1524 1525 1528 1533 1550 1666 1900
SEEN-BY: 5030/2127 5031/47 70 5035/38 5036/34 5040/47 5042/13 5049/50 5053/16
SEEN-BY: 5054/1 8 9 18 37 45 63 67 5059/9 37 5061/120 5062/1 10 5063/3 5067/2
SEEN-BY: 5069/7 5070/1222 5077/70 5080/80 1003 5083/21 5085/13 5090/108 113
SEEN-BY: 5095/20 5096/18 5099/11 6000/12 254 6001/10 6090/1
PATH: 5030/1243 1900 5020/4441 545 5054/1 37