Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

Programming 1 (BI)
  ▸ exercises
  ▸ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C#
* D lang.
* Java
* Nim
* Nim2
  + exercises
* XC=BASIC
* old
  ✦C++, ✦Clojure, ✦Scala


[ edit | logout ]
[ sandbox | passwd ]

execute a shell command

See also https://nim-lang.org/docs/os.html#execShellCmd%2Cstring

proc execShellCmd(command: string): int

"Command has the form 'program args' where args are the command line arguments given to program. The proc returns the error code of the shell when it has finished (zero if there is no error). The proc does not return until the process has finished."

execute a shell command
import os

url = "https://wallpaperset.com/w/full/8/4/c/65358.jpg"

cmd = f"wget '{url}' -O subnautica.jpg"

print(cmd)
os.system(cmd)
import std/strformat   # &"Hello {name}!"
import std/os

let
  url = "https://wallpaperset.com/w/full/8/4/c/65358.jpg"
  cmd = &"wget '{url}' -O subnautica.jpg"

echo cmd
discard execShellCmd(cmd)

It's always a good idea to print the command first and check if it's OK. If good, then you can call it in an external process.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2026 May 22, 22:19