You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.4 KiB
Bash

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#! /bin/bash
printf "Hello $(whoami), on a network you can call me $(hostname)\n"
echo "or join me on those adresses : "
ip a s en0 | grep inet
printf "\nCurrently, I'm working with\n"
who
printf "\nI am running a $(uname -s) kernel, version $(uname -r)\n"
printf "\nthe date is : $(date)\n"
printf "\nHere's some informations about me :\n"
top | head -n 10
Here is what the script is printing on the screen
flavien@PlutoMac | ~ vim lab3.sh
flavien@PlutoMac | ~ ./lab3.sh
Hello flavien, on a network you can call me PlutoMac.local
or join me on those adresses :
inet6 fe80::860:77b2:5066:7a33/64 secured scopeid 0x6
inet 149.157.97.250/19 brd 149.157.127.255 en0
Currently, I'm working with
flavien console Oct 19 23:37
flavien ttys000 Oct 20 13:24
I am running a Darwin kernel, version 19.6.0
the date is : Mar 20 oct 2020 15:56:40 GMT
Here's some informations about me :
Processes: 538 total, 3 running, 535 sleeping, 2451 threads
2020/10/20 15:56:41
Load Avg: 1.77, 1.46, 1.50
CPU usage: 2.30% user, 5.42% sys, 92.27% idle
SharedLibs: 308M resident, 73M data, 28M linkedit.
MemRegions: 270285 total, 7716M resident, 211M private, 5166M shared.
PhysMem: 30G used (3667M wired), 1957M unused.
VM: 4136G vsize, 1993M framework vsize, 32325401(0) swapins, 33343564(0) swapouts.
Networks: packets: 41419280/46G in, 24502670/5779M out.
Disks: 6327672/221G read, 10727070/236G written.
On a different computer (the interface is called vmbr0, and i needed only the
5 first lines of the top command)
flavien@saturn:~$ ./lab3.sh
Hello flavien, on a network you can call me saturn
or join me on those adresses :
inet 192.168.1.250/24 scope global vmbr0
inet6 2a01:e0a:3bb:32f0::250/64 scope global
inet6 fe80::226:55ff:fee5:a5fa/64 scope link
Currently, I'm working with
flavien pts/7 2020-10-20 16:57 (149.157.97.250)
flavien pts/9 2020-10-20 16:57 (tmux(19282).%1)
I am running a Linux kernel, version 5.4.65-1-pve
the date is : Tue 20 Oct 2020 05:02:32 PM CET
Here's some informations about me :
top - 17:02:51 up 46 days, 15:11, 2 users, load average: 0.30, 0.45, 0.39
Tasks: 502 total, 2 running, 500 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.3 us, 3.7 sy, 0.0 ni, 91.4 id, 1.3 wa, 0.0 hi, 1.4 si, 0.0 st
MiB Mem : 32028.1 total, 4165.2 free, 26450.5 used, 1412.4 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 5097.4 avail Mem