Articles Hierarchy

Articles Home » RPI » play BASH and Color, SYSINFO and INSTALL

play BASH and Color, SYSINFO and INSTALL

intro
+ package install
+ + sysinfo script
+ + + my alias
+ + + + bash menu timeout

intro
i found some info for change color of BASH script output and play with it.

and got the idea i can use it in my latest scipts.
packages install
+ + regarding apt-get package search and check for install

nano SW
with this
chmod +x SW
./SW xxx

new version has a menu with the options:
- install
- back ( new search param )

looks like

and is much faster and easier to use as synaptic...


sysinfo script
+ + regarding rework my netinfo and sysinfo tool into one
( rev 2018_04_15 incl Monitor info new: CLI args to -hVvcplm)
nano raspi-info
with this
chmod +x raspi-info or just use bash raspi-info
./raspi-info
or long version: ./raspi-info -v
or new mini version: ./raspi-info -m
or to file ./raspi-info -vc | tee raspi-info.txt
cat raspi-info.txt | more

the result is long, here just how the end looks like

this tool is great to readback setup and status info, but lets say you have network problems
then you need it, but how to do when you can not use Copy&Paste to
Terminal || Putty Terminal || VNC Desktop terminal
go the long way from your PC make that script file on a USB stick.
usually linux not allow to run it , so should copy to /home/pi/ and make it executable,
but can also try from USB with sudo bash raspi-info
pls read this script first,
but i assure you that this tool not make any changes... just read back, as the name said:

raspi-info




my alias
every time you start a (linux) terminal
the .bashrc is executed. and that has the option to run a
.bash_aliases
so, the idea is that you can define your own
alias mycmd='linuxcmd' in that file
and it is again valid when you login again.
so you are home:
cd /home/pi/
nano .bash_aliases
with this
and next time you open terminal it looks like

so NOW you are REALLY home ( and i feel like working RSX-11M os again )

you should test it first, and delete / comment out what you not need or not fit to your environment
or make new alias. ( close / open new terminal required )
pls for this first test it in a terminal if that new command already exists, so you not REDEFINE existing commands.

what are the little tricks:
+ you make your own alias
+ you print a text what list that alias so you not forget them
+ you use that like any bash file to show some system info on screen
+ to highlight use terminal colors
but the most basic function:
there is a alias
work
what brings you to your current working directory
and it is also "executed" at the end of that login / new terminal
but every time you start a new project you need to change that: so there is a alias
workedit
what calls your editor for the .bash_aliases file.
that is a great combo.


p.s. the color thing works from python too forum
again used here


bash menu timeout
sorry, was a unusual question @4um:
startup to terminal, but auto start desktop after timeout ( no user interruption ) so i changed my bash menu to a default other than QUIT. ( using 'sudo raspi-config' as example )

code here