Questions tagged [syntax]
The syntax tag has no summary.
206 questions
14 votes
2 answers
1k views
Why do shell control statement have that syntax (semicolon/newline+then/do)
I of course realize the need to have something that separates the condition to the actual commands to be executed under the control statement, but why were it chosen to use both semicolon and a ...
2 votes
2 answers
387 views
Can I execute multiple case blocks if the pattern matches?
I want to know if there is another alternative in Bash to execute multiple blocks when the pattern matches. I don’t want to use another command, if statements, or two or more separate case blocks or ...
0 votes
1 answer
122 views
Should my cat utility support multiple keys simultaneously?
So, i was given a task to implement simple version of cat utility. It should support some of GNU keys, for given text returns the same results as real cat utility and i was given this synopsis: cat [...
2 votes
2 answers
704 views
Merging values from 2 YAML files in bash
A bash command: $(System.DefaultWorkingDirectory)/yq_linux_amd64 '. *= load("${{ parameters.HELM_CHART_PATH }}/values/DEV/${{ parameters.COMPONENT }}.yaml")' ${{ parameters.HELM_CHART_PATH }}...
0 votes
4 answers
144 views
Details with bash's syntax checking and breaking over several lines
There are two cases in which I do not understand why bash behaves as it behaves regarding syntax checking and asking for a newline. Case 1 bash can execute the line ( (ls) | cat), but depending on ...
-5 votes
1 answer
73 views
After wrote prompt $ sort [closed]
After I wrote prompt $ sort display doesn't shown anything what the next step?
0 votes
5 answers
194 views
What is the difference between using code $variable and ${variable}2?
What is the difference between using code $variable and ${variable}2 ? Example: file ='GLOBAL_AR_COLLECTOR_COMMENTS20240614ALYSSAB.TXT' prefix ='GLOBAL_AR_COLLECTOR_COMMENTS' In my shell script code ...
3 votes
1 answer
259 views
Convention of parameter naming - undocumented options
GNU has long pushed for a combination of short options (-h) and long options (--help), which goes a long way to clearing up the syntactical mess of commands like tar and dd, with their legacy syntax ...