42/d09/ex09/where_am_i.sh

22 lines
1,021 B
Bash
Raw Normal View History

2016-11-20 02:20:23 +02:00
# **************************************************************************** #
# #
# ::: :::::::: #
# where_am_i.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gtertysh <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/04 03:35:14 by gtertysh #+# #+# #
# Updated: 2016/11/04 04:01:02 by gtertysh ### ########.fr #
# #
# **************************************************************************** #
IPS=$(ifconfig | grep "inet " | cut -d " " -f2)
if [ -z "$IPS" ]
then
echo "Je suis perdu!"
else
echo $IPS | tr " " "\n"
fi