* [Comm] Функция в zsh в качестве алиаса
@ 2004-09-01  6:19 php-coder
  2004-09-01  8:17 ` Andrey Rahmatullin
  0 siblings, 1 reply; 2+ messages in thread
From: php-coder @ 2004-09-01  6:19 UTC (permalink / raw)
  To: community
0000100101011110100100101::01.09.2004::0110001001001000100111100100010
  Привет, Linuxоиды!
  
  Хочу в качестве alias'а использовать функцию. Правда, незнаю как
  это лучше сделать... Вот как я попытался (кусок из ~/.zshrc):
  
  finction insert_disk()
  {
   if [ -z $1 ];
   then
     echo "Вы не указали номер диска!" > /dev/stderr
     return 1
   else
     sudo mount -o loop /mnt/other/distrib/alt/alt-${1}.iso /mnt/cdrom
   fi
  }
  ...
  alias диск='insert_disk()'
  
  При вызове (диск 1, к примеру) молча отрабатывается, но диск не
  монтируется... Куда копать? Где править?
  
  THX
  
-- 
  С уважением, php-coder (mailto:php-coder[at]ngs[dot]ru)
  Registered Linux User #327594
  ALT Linux Master 2.2 (kernel 2.4.27)
010010010010010001010101100::Linux RuleZz!::10001001000100010001000111
^ permalink raw reply	[flat|nested] 2+ messages in thread
* Re: [Comm] Функция в zsh в качестве алиаса
  2004-09-01  6:19 [Comm] Функция в zsh в качестве алиаса php-coder
@ 2004-09-01  8:17 ` Andrey Rahmatullin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Rahmatullin @ 2004-09-01  8:17 UTC (permalink / raw)
  To: community
[-- Attachment #1: Type: text/plain, Size: 572 bytes --]
On Wed, Sep 01, 2004 at 01:19:39PM +0700, php-coder wrote:
>  Хочу в качестве alias'а использовать функцию. Правда, незнаю как
>  это лучше сделать... Вот как я попытался (кусок из ~/.zshrc):
>  
>  finction insert_disk()
finction или function?
И вообще слово function не надо.
И вообще попробуйте диск().
>  alias диск='insert_disk()'
А если без скобок?
-- 
WBR, wRAR (ALT Linux Team)
Powered by the ALT Linux fortune(8):
Кстати, у меня есть основания полагать, что rsh-клиент может быть уязвимым
к атакам со стороны rsh-сервера.
		-- ldv in devel@
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-01  8:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-01  6:19 [Comm] Функция в zsh в качестве алиаса php-coder
2004-09-01  8:17 ` Andrey Rahmatullin
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git