I'm trying to jump start my Linux (Centos) knowledge and trying to understand what is "default" Shell Functions listed by declare -F
. No idea what these functions is called, I just label them as "default".
I googled it, but what I got is about scripting. Is there article which explain what are they for, where (defined in which file), purpose and usage. Or someone can give a short write-up?
From the look of it, they look like utilities.
For example; declare -f _have
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
What is the type $1
do?
BTW, I created one from the shell prompt function App1 ()
, then { ls }
, when I check using declare -f App1
found ls had became ls --color=auto
.
VAR=Apple ls
only sets VAR for the duration ofls
; it's gone afterwards. UsingVAR=Apple; ls
sets VAR in the current shell (but doesn't export it). – Jeff Schaller Dec 07 '18 at 18:30VAR5=GG echo ${VAR5}test
and the output istest
, then I triedVAR5=GG ; echo ${VAR5}test
and the output is as expectedGGtest
. Still trying to figure out, shouldn't the first one also returnedGGtest
?. As far as I know bash_completion.sh provide a set of utilities, but I still wonder is it important/commonly used? Will disabling it break things? It look dated in the distro, so it kind of make me curious. Anyway, I need to get my fundamental knowledge up first. – Yew Hang Dec 10 '18 at 03:39