I'm trying to read commands from a text file and execute each line from a bash script.
#!/bin/bash
while read line; do
$line
done < "commands.txt"
In some cases, if $line
contains commands that are meant to run in background, eg command 2>&1 &
they will not start in background, and will run in the current script context.
Any ideea why?