Skip to main content

Questions tagged [control-flow]

Control flow refers to the order that computer code is executed in when a program or script is running. Examples include loops (code is repeated) and conditionals where one branch is run instead of another. Use this tag for questions about control flow in scripts or programs – not questions about terminal flow control.

10 votes
4 answers
943 views

Without ;;&, /bin/sh gives Syntax error: ")" unexpected (expecting ";;"). ;;& triggers shellcheck's ^-- SC2127 (error): To use cases with ;;&, specify #!/usr/bin/env ...
Swudu Susuwu's user avatar
0 votes
1 answer
156 views

I'm very simply wondering if, in a bash script, a new line is functionally 100% equivalent to &&? e.g.: #!/bin/bash 7z x "${file}" mv "${file}" "${new_file}" ...
s.k's user avatar
  • 521
5 votes
3 answers
985 views

I want to detect errors in application's execution logic. E.g.: forgot to call free() on address returned by malloc() did not close file handle returned by open() invalid flags passed to open() ...
zomega's user avatar
  • 1,022
0 votes
0 answers
15 views

in my script an if statement returns: line 3: []: command not found the statement: if ["$(pidof -x $(basename $0) -o %PPID)"]; then echo process already running; exit; fi what I tried: ...
andy's user avatar
  • 1
2 votes
1 answer
427 views

I often execute raw versions of remote Bash scripts in GitHub with this pattern: wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | ...
variable_expander's user avatar
0 votes
2 answers
343 views

I am working on an automated pull request check via GitHub actions and I want to preserve some data from a command's stderr output between jobs. For this, I need to write the stderr to an artifact ...
Abhishek Jain's user avatar
4 votes
2 answers
5k views

I'm currently refactoring a script which has slowly grown beyond control. I'm trying to spin off repetition into functions. However, I have a repeated test being called from a loop, and want it to ...
Stripy42's user avatar
7 votes
2 answers
1k views

I am studying Linux device drivers, my main focus is on wifi drivers. I want to know how the code flows when I plugin my device. Maybe, I can do something like add a printk line in every function. ...
Akshdeep Singh's user avatar

15 30 50 per page
1
2 3 4 5 6