Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - Русский - 日本語
Aide de Scilab >> Entrées/Sorties > host

host

exécution d'une commande Unix ou DOS

Séquence d'appel

stat=host(command-name)

Paramètres

command-name

chaîne de caractères contenant les commandes à exécuter

stat

un entier

Description

Envoie la chaîne command-name à l'interpréteur de commande (sh sous Unix, ou command.com sous DOS). La sortie standard et les erreurs sont reportées dans l'interpréteur de commande.

stat vaut -1 en sortie si la fonction ne peut pas être appelée (pas assez de mémoire par exemple) ou alors le code de sortie de l'interpréteur de commande.

Exemples

//creation d'un fontion pour recuperer la path courant
function wd=getdir()
  if getos() == 'Windows' then 
    host('cd>'+TMPDIR+'\path');
  else
    host('pwd>'+TMPDIR+'/path');
  end
  wd=read(TMPDIR+'/path',1,1,'(a)')
endfunction
//appel de la fonction
wd=getdir()

Voir aussi

  • edit — function editing
  • manedit — editing a manual item
  • unix_g — exécution d'une commande Unix ou DOS, sortie redirigée vers une variable
  • unix_s — exécution d'une commande Unix ou DOS, pas de sortie
  • unix_w — exécution d'une commande Unix ou DOS, sortie redirigée vers la fenêtre de Scilab
  • unix_x — exécution d'une commande Unix ou DOS, sortie redirigée vers une fenêtre
Scilab Enterprises
Copyright (c) 2011-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:31:06 CEST 2016