Monday, April 29, 2024
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 162233  / 3 Years ago, fri, may 28, 2021, 7:23:41

On AskUbuntu, I've seen a few commands around that look quite complicated, with lots of symbols in them. To get a better understanding of how these commands are built up, I'd like to know what the symbols stand for.



For example:



find ~/ -name *.c -exec sed -i "s/cybernetnews/cybernet/g" {} ;



or even more complicated:



echo -e "e[${i#*=}m$( x=${i%=*}; [ "${!x}" ] && echo "${!x}" || echo "$x" )e[m"



I understand very well that adding parameters as -c, --debug, have certain effects on the main commmand. The meanings of these are in almost all cases to be found in the man pages, so that's not really what I'm looking for.



Please, try in your answer to define what the symbols specifically do, instead of explaining the examples I gave. That could look like this:



" means 'argument': the main command uses anything within these symbols as its source
^ is used for ...
# is used for ...


Thanks in advance


More From » command-line

 Answers
5

See The Bash Reference Manual section called Shell-Operation and the Advanced Bash-Scripting Guide Chapter 3 (Special Characters).



I refer to those anytime I need to learn something new about shell scripting in ubuntu/linux.



I think you will find ABS Chapter 3 the easiest to navigate for your purposes. All the symbols are seen on the far left of the page with a description immediately below them.


[#41604] Friday, May 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ellter

Total Points: 311
Total Questions: 111
Total Answers: 117

Location: Lithuania
Member since Thu, Jul 14, 2022
2 Years ago
;