Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Aide 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
Report an issue
<< getpid Entrées/Sorties setenv >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:37:22 CEST 2012