Reputation
24,513
Top tag
Next privilege 25,000 Rep.
Access to site analytics
Badges
3 59 94
Newest
 Enlightened
Impact
~1.3m people reached

Jan
20
comment Can someone please explain this error I'm getting in my script
Put shopt extglob on the line before the cp command and post what it prints out.
Jan
19
comment How to call a script after every bash command
@PSkocik "prior to every command == after every command + at the beginning of your bash session" -- true for strict sequencing but no longer holds when time is considered. If you want something that depends on the time you hit the Enter key that is much harder to do.
Jan
15
comment How to wait for all spawned and backgrounded processes to finish in bash script
The wait and $! constructs are shell tools for controlling jobs / processes your shell spawns. In your description, the only process your shell spawns is BAR, and by your description, BAR exits immediately after spawning some opaque background stuff. Your shell can't see that background stuff BAR does, only BAR, so it doesn't even have any background jobs / processes to use wait / $! on. If you need a mechanism to know whether the internal background process spawned by BAR exit FOO1 worked, it has to come from BAR.
Jan
13
comment Recursive Function not Working
(a) You can't cd to non-directories. (b) Relative paths will stop working if you keep changing your current directory. Either go back to the previous directory or use absolute paths. (c) Don't use $(echo *), that's both broken and inefficient, just use */ (or "$PWD"/*/ for absolute paths).
Jan
6
answered how to find the start location of a changing substring in a longer string
Dec
21
awarded  Nice Answer
Dec
16
awarded  Enlightened
Dec
16
awarded  Nice Answer
Dec
7
comment How are parentheses interpreted at the command line?
@CMCDragonkai The $() is command substitution, the () is a subshell. Both of them run commands, the difference is what happens to the output. The names are much easier to search than the symbols. See also unix.stackexchange.com/q/213530/9537
Dec
2
awarded  Nice Answer
Nov
23
awarded  Nice Answer
Nov
21
awarded  Nice Answer
Nov
13
awarded  Announcer
Oct
28
awarded  Enlightened
Oct
28
awarded  Nice Answer
Oct
12
awarded  Enlightened
Oct
12
awarded  Nice Answer
Oct
6
awarded  Enlightened
Oct
6
awarded  Nice Answer
Sep
4
comment how to echo $, & symbols correctly?
You shouldn't be looking at windows batch file information for help with bash. They are different things.