Skip to content

Commit 1d6813f

Browse files
committed
Updates of BASH.
1 parent 98e2ddf commit 1d6813f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

presentation/linux_bash_metacentrum_course.tex

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,11 +1297,13 @@ \subsection{BASH}
12971297
\item \textbf{Interpreter of our commands inserted into command line}
12981298
\item \textbf{BASH} --- Bourne again shell
12991299
\begin{itemize}
1300-
\item Probably the most common shell, based on original \texttt{sh}, respecting original specification, adding new features
1300+
\item Probably the most common shell, based on original \texttt{sh}, respecting original specification, adding new features; probably the most common
13011301
\item We will use it
13021302
\end{itemize}
1303-
\item Other variants: \textbf{csh} (syntax influenced by C), \textbf{ksh} (younger, backward compatible with bash), \textbf{zsh} (extended bash), \textbf{ash} (mainly in BSD)
1304-
\item There are some differences in syntax and features
1303+
\item Other variants: \textbf{csh} (syntax influenced by C), \textbf{ksh} (younger, backward compatible with bash), \textbf{zsh} (extended bash; probably the most advanced, not so common), \textbf{ash} (mainly in BSD)
1304+
\begin{itemize}
1305+
\item There are some differences in syntax and features
1306+
\end{itemize}
13051307
\item Language suitable for easy scripting and system tasks, not for \enquote{big} programming, neither for graphical applications
13061308
\end{itemize}
13071309
\end{frame}
@@ -1350,18 +1352,18 @@ \subsection{BASH}
13501352
\item In any text editor open \texttt{$\sim$/.bashrc} (and/or \texttt{$\sim$/.bash\_profile}) and edit it
13511353
\item Behavior of BASH can be set to fit user's needs
13521354
\item Terminal emulators allow to set custom fonts and colors,~\ldots
1353-
\item Prompt can be colored using custom values of \texttt{PS1} and \texttt{PS2} variables (\texttt{export PS1='\ldots'}), see \href{https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/}{examples}
1355+
\item Prompt can be colored using custom values of \texttt{PS1} and \texttt{PS2} variables (\texttt{export PS1='\ldots'}), see \href{https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/}{examples} and \href{https://duckduckgo.com/?t=ffab\&q=how+to+customize+linux+bash+prompt\&ia=web}{search}
13541356
\end{itemize}
13551357
\vfill
13561358
\begin{bashcode}
1357-
# More colors for outputs (typically ls)
1358-
eval "$(dircolors -b)"
1359+
eval "$(dircolors -b)" # More colors for outputs (typically ls)
13591360
# Colored GCC warnings and errors (useful for compilation)
13601361
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:
13611362
locus=01:quote=01'
1362-
# Example of more colorful prompt
1363-
export PS1='\u@\h:\w\$'
1364-
export PS2='\u@\h:\w\$'
1363+
# Example of more colorful prompt (do the same for PS2)
1364+
export PS1='\[\033[0;34m\]\u\[\033[0m\]@\[\033[0;32m\]\h\[\033[0m\]:
1365+
\[\033[1;31m\]\w\[\033[0m\]\$ ' # Everything on single line without space
1366+
export PS1='\[\033[0;32m\]\d:\t \[\033[0m\]\[\033[1;31m\]\w\[\033[0m\]$ '
13651367
\end{bashcode}
13661368
\end{frame}
13671369

0 commit comments

Comments
 (0)