this post was submitted on 28 Jun 2023
15 points (100.0% liked)

Linux

47232 readers
775 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
15
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

I wonder is there any program that can take a bash script as input and print out all bash commands it will run? A program that would unroll loops, expand environment variables and generally not perform any destructive action nor call any external binaries. It's like a dry run of sorts.

you are viewing a single comment's thread
view the rest of the comments
[–] wolf 1 points 1 year ago

Of course, if you narrow the problem scope you might be able to solve it. OP was talking about unrolling loops etc. which I interpreted as having the exact amount of times a loop is executed. AFAIK this would lead to a state explosion for nearly all non-trivial cases, and we already now that knowing if a program (incl. loops) terminates is not generally solvable.