Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

check if lfs compatible

cat > version-check.sh << "EOF"
#!/bin/bash
# Simple script to list version numbers of critical development tools
export LC_ALL=C
bash --version | head -n1 | cut -d" " -f2-4
MYSH=$(readlink -f /bin/sh)
echo "/bin/sh -> $MYSH"
echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash"
unset MYSH

echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1

if [ -h /usr/bin/yacc ]; then
  echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
elif [ -x /usr/bin/yacc ]; then
  echo yacc is `/usr/bin/yacc --version | head -n1`
else
  echo "yacc not found" 
fi

bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1

if [ -h /usr/bin/awk ]; then
  echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
elif [ -x /usr/bin/awk ]; then
  echo awk is `/usr/bin/awk --version | head -n1`
else 
  echo "awk not found" 
fi

gcc --version | head -n1
g++ --version | head -n1
ldd --version | head -n1 | cut -d" " -f2-  # glibc version
grep --version | head -n1
gzip --version | head -n1
cat /proc/version
m4 --version | head -n1
make --version | head -n1
patch --version | head -n1
echo Perl `perl -V:version`
python3 --version
sed --version | head -n1
tar --version | head -n1
makeinfo --version | head -n1  # texinfo version
xz --version | head -n1

echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c
if [ -x dummy ]
  then echo "g++ compilation OK";
  else echo "g++ compilation failed"; fi
rm -f dummy.c dummy
EOF

bash version-check.sh
Comment

PREVIOUS NEXT
Code Example
Shell :: git ignore is not working on local repository 
Shell :: how to debug istio 
Shell :: extension install 
Shell :: separate a file using a tag 
Shell :: using httrack on linux command line 
Shell :: Git Kraken update Linux 
Shell :: cocoapods "iphoneos" cannot be located 
Shell :: executar python como parametro 
Shell :: read not working in shell script 
Shell :: metallb loadbalancer service pending 
Shell :: combine two files as columns 
Shell :: powershell file already exists 
Shell :: linux reset date on file 
Shell :: Install solidity complier 
Shell :: git roll back to a point 
Shell :: nvm removes globally installed packages 
Shell :: nuget system.web.http.webhost 
Shell :: sshkeygen validate keys 
Shell :: 1 exception(s): Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: SignatureLockersCarrierModelCarrierLockersCarrier 
Shell :: pcmanfm resycle bin 
Shell :: linux command to check running process 
Shell :: wrong domain calling on same hosting ubuntu server 
Shell :: rsync exclude symlinks 
Shell :: bluetooth turned off even if switched on 
Shell :: check folder exist else create linux 
Shell :: keytool list certs java 
Shell :: cashier paddle installation 
Shell :: Powershell mount disk image and retrieve drive-letter 
Shell :: The following packages have unmet dependencies: linux-headers-5.16.0-12parrot1-amd64 : Depends: linux-compiler-gcc-11-x86 
Shell :: How to redirect docker-compose command stdout stderr from docker container to file 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =