![]() |
Olá e boas-vindas de Estados Unidos para o UNIX e Linux Forum! Obrigado por visitar e fazer parte da nossa comunidade global.
|
|
google unix.com
|
|||||||
| Fóruns | Registar | Fórum Regimento | Ligações | Álbuns | FAQ | Lista deputados | Calendário | Pesquisa | Today's Posts | Mark Forums Read |
| UNIX & avançada para usuários experientes Especialista-a-Expert. Saiba avançado UNIX, comandos UNIX, Linux, Sistemas Operativos, Administração de Sistemas, Programação, Shell, shell scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
|
||||
| Fio | Thread Starter | Fórum | Respostas | Última postagem |
| Para converter um arquivo para múltiplos formato legível formato ASCII | gaur.deepti | UNIX para Dummies Perguntas & Respostas | 5 | 03-25-2008 03:03 |
| Converso UTF8 Formato arquivo para formato ANSI | rajreddy | UNIX para Dummies Perguntas & Respostas | 9 | 05-25-2007 09:26 |
| Converso UTF8 Formato arquivo para formato ANSI | rajreddy | UNIX & avançada para usuários experientes | 1 | 05-24-2007 07:40 |
| converter mmddaa formato de data para ccyyddd formato? | Bhups | Programação Shell Script e | 2 | 09-28-2006 12:30 |
| alterar a função de esvaziar o formato antigo para o novo formato | powah | Programação Shell Script e | 0 | 06-23-2005 01:17 |
![]() |
|
|
Linkback | Thread Tools | Pesquisar este Thread | Rate Thread | Display Modes |
|
|
|
||||
|
se formato em funções
Oi a todos,
Estou recebendo este erro: 0403-057 Syntax erro na linha 6: `) 'não é esperado. quando tento entrar na minha função se uma condição da forma: #! / bin / ksh do_t () ( var1 \u003d "teste"; recompr \u003d 0; [[$ 1-eq 1]] & & (printit \u003d 0; F_N_s \u003d "teste". "Xx". "Yy;) ) do_t 1 ########### Que não estou fazendo isso direito? se eu substituir o caso com o outro formato ou seja, if [[$ 1-eq 1]]; então printit \u003d 0; F_N_s \u003d "teste". "xx". "yy; fi ele funciona bem Por favor, me avise. Obrigado! |
|
|||||
|
Oi.
Enquanto um obedece a regras de sintaxe, muitas formas são possíveis: Código:
#!/usr/bin/env ksh
# @(#) s1 Demonstrate syntax allowed for shell functions, ksh.
echo
export LC_ALL=C
echo "Environment: LC_ALL = $LC_ALL"
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version "=o" $(_eat $0 $1)
echo
one()
{
echo " One called." >&2
return 0
}
two(){
echo " Two called." >&2
return 0
}
three(){ echo " Three called." >&2 ; return 0
}
four(){ echo " Four called." >&2 ; return 0 ; }
echo
echo " Results, calling one, two, three, four."
one
two
three
four
exit 0
Código:
% ./s1 Environment: LC_ALL = C (Versions displayed with local utility "version") OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64 Distribution : Debian GNU/Linux 5.0 ksh 93s+ Results, calling one, two, three, four. One called. Two called. Three called. Four called. |
![]() |
| Marcadores |
| Thread Tools | Pesquisar este Thread |
| Display Modes | Esta taxa Thread |
|
|