«   2021/04   »
        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  
04-16 16:02
Notice
Today
179
Total
1,418,482
관리 메뉴

변군이글루

[스크립트] 운영체제 및 gcc 버전 체크 스크립트 본문

* 스크립트

[스크립트] 운영체제 및 gcc 버전 체크 스크립트

변군 변군이글루 2021. 2. 1. 18:12

운영체제 및 gcc 버전 체크 스크립트

gv.sh 편집

$ vim gv.sh
#!/bin/bash

echo -n "운영체제 버전 => "
if [ -f /etc/redhat-release ]; then
	cat /etc/redhat-release
elif [ -f /etc/os-release ]; then
	cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | cut -d"=" -f2 | cut -d"\"" -f2
else
	echo "Other"
fi
echo -n "BIT => "
getconf LONG_BIT
echo -n "kernel version => "
uname -r
echo "--"
echo "GCC Compiler 버전"
echo "gcc version =>"
gcc --version
echo "gcc-c++ version =>"
g++ --version
echo "--"
echo "libtool version =>"
if [ -f /etc/redhat-release ]; then
	libtool --version
elif [ -f /etc/os-release ]; then
	libtoolize --version
else
	echo "Other"
fi
echo -e "\nautoconf version =>"
autoconf --version
echo -e "\nautomake version =>"
automake --version
echo "--"
echo "make version =>"
make --version

gv.sh 실행 권한 추가

$ chmod +x gv.sh

 

gv.sh 실행

$ ./gv.sh

$ ./gv.sh
운영체제 버전 => Ubuntu 20.04.1 LTS
BIT => 64
kernel version => 5.4.0-65-generic
--
GCC Compiler 버전
gcc version =>
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc-c++ version =>
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--
libtool version =>
libtoolize (GNU libtool) 2.4.6
Written by Gary V. Vaughan <gary@gnu.org>, 2003

Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

autoconf version =>
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

automake version =>
automake (GNU automake) 1.16.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.
--
make version =>
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 

 

 

0 Comments
댓글쓰기 폼