-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsindoublearray.sh
More file actions
34 lines (30 loc) · 888 Bytes
/
psindoublearray.sh
File metadata and controls
34 lines (30 loc) · 888 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
28
29
30
31
32
33
34
#!/bin/bash
# ******************************************************************************************
# *
# * File: psindoublearray.sh
# *
# * Function: Puts in two arrays data for all the processes in the system
# *
# * Author: Luca Marzo
# *
# * Course: Sistemi Operativi I - Facoltà di Ingegneria - Università del Salento
# *
# * Copyright: CreativeCommons 2012 - Attribution-Noncommercial-Share Alike 2.5 Generic
# *
# * Notes:
# *
# * Change History:
# * Thu Apr 19 15:34:27 CEST 2012 Prima stesura
# *
# ******************************************************************************************
#
primoarray=($(ps -e -opid=))
for ((i=0; i < ${#primoarray[*]}; i++ ))
do
secondoarray[i]=$(ps -p ${primoarray[i]} -ouid=)
done
#Stampa a video gli array creati
for (( i=0; i < ${#primoarray[*]}; i++ ))
do
echo ${primoarray[i]}-----${secondoarray[i]}
done