bash - How do I read the first line of lscpu? -


i learning bash right on own.

i'm trying write if else statement small script i'm writing. want script read lscpu command check if system x86 or 64 bit system. think can me?

basically script installs favorite programs ubuntu system. of programs not in depository , therefore have install offsite. however, of them have different installer files different architectures.

pseudo code:

if [firstlineoflscpu = architecture:          x86_64] install blahblah else blahblahblah fi 

to answer question:

if lscpu | grep architecture | grep -q x86_64   # install 64-bit version else   # else fi 

however, notice uname command, may more direct:

$ uname -i x86_64 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -