-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadstdin.sh
More file actions
27 lines (26 loc) · 745 Bytes
/
readstdin.sh
File metadata and controls
27 lines (26 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# ******************************************************************************************
# *
# * File: readstdin.sh
# *
# * Function: read from standard input
# *
# * Author: Franco Tommasi
# *
# * Course: Sistemi Operativi I - Facoltà di Ingegneria - Università del Salento
# *
# * Copyright: CreativeCommons 2008 - Attribution-Noncommercial-Share Alike 2.5 Generic
# *
# * Notes: Esempio di script che esegue lettura da standard input
# *
# * Change History:
# * 18/02/09-23:04 Prima stesura
# *
# ******************************************************************************************
#
line=0
while (( line < 4096 )) && read buf[line]
do
echo -e $line \\t ${buf[line]}
(( line = line + 1 ))
done