Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. echo (Unix) - Teknopedia
echo (Unix) - Teknopedia

echo è un comando dei sistemi operativi Unix e Unix-like, e più in generale dei sistemi POSIX[1], che scrive i suoi parametri sullo standard output (tipicamente sul terminale da cui il comando è stato eseguito), solitamente usato negli script di shell per visualizzare messaggi informativi e/o per scrivere del testo in un file. Varianti di tale comando sono disponibili anche in altri sistemi operativi, tra i quali MS-DOS, AmigaOS[2], Microsoft Windows[3] e OS/2.

Sintassi

[modifica | modifica wikitesto]

La sintassi generale di echo è la seguente:

echo [arg1 …]

I parametri arg indicano il testo da scrivere sullo standard output.

In alcune varianti di Unix, ma anche nella versione GNU[4], il comando echo supporta anche delle opzioni, tra cui ad esempio vi sono -n e -e che influenzano il modo in cui i parametri sono interpretati ed il modo in cui sono visualizzati. Si tratta tuttavia di opzioni non standard a causa di incompatibilità storiche tra i sistemi BSD e System V; dove si presentano problemi è possibile utilizzare il comando printf.

Esempi di utilizzo

[modifica | modifica wikitesto]

Il comando visualizza la scritta Questo è un testo.:

$ echo Questo è un testo.
Questo è un testo.

Il comando scrive Questo è un testo. nel file test.txt usando la redirezione tramite l'operatore "maggiore". Il contenuto del file viene poi visualizzato tramite il comando cat:

$ echo "Questo è un testo." > test.txt
$ cat test.txt
Questo è un testo.

Altri linguaggi

[modifica | modifica wikitesto]

Il comando echo è presente anche in alcuni linguaggi di programmazione, come PHP[5], per produrre un output di una o più stringhe.

Note

[modifica | modifica wikitesto]
  1. ↑ (EN) echo, in The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition. URL consultato il 02-01-2009.
  2. ↑ (EN) AmigaDOS/Echo[collegamento interrotto], su utilitybase.com. URL consultato il 02-01-2009.
  3. ↑ (EN) echo, in Windows XP Command-line reference A-Z. URL consultato il 02-01-2009.
  4. ↑ (EN) echo: Print a line of text, in GNU Coreutils manual. URL consultato il 02-01-2009.
  5. ↑ Manuale di PHP: echo, su it.php.net. URL consultato il 1º maggio 2007 (archiviato dall'url originale il 18 maggio 2007).
V · D · M
Programmi Unix/Unix-like con interfaccia a riga di comando e comandi interni della shell unix
File systemcat · cd · chattr · chmod · chown · chgrp · cksum · cmp · cp · du · df · fdisk · file · fsck · fuser · gzip · ln · ls · lsattr · lsof · mkdir · mknod · mount · mv · pwd · rm · rmdir · split · tar · touch · umount · umask
Processiat · chroot · crontab · exit · kill · killall · nice · nohup · pgrep · pidof · pkill · ps · pstree · sleep · time · top · wait
Ambiente utentealias · env · export · finger · id · logname · mesg · newgrp · passwd · su · sudo · uname · uptime · w · wall · who · whoami · write
Elaborazione testoawk · comm · cut · diff · ed · ex · fmt · head · iconv · join · less · more · paste · sed · sort · tail · tr · uniq · vi · wc · xargs
Script di shellbasename · dirname · echo · expr · false · printf · test · true · unset
Retedig · nslookup · ifconfig · netstat · ping · rcp · rlogin · route · netcat · traceroute
Ricerchefind · grep · strings
Amministrazionedmesg · groupadd · groupdel · groupmod · mdadm · shutdown · useradd · userdel · usermod
Altribanner · bc · cal · clear · date · dd · lp · man · size · tee · tput · yes
  Portale Informatica: accedi alle voci di Teknopedia che trattano di informatica
Estratto da "https://it.wikipedia.org/w/index.php?title=Echo_(Unix)&oldid=134336875"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022