Reputation
24,483
Top tag
Next privilege 25,000 Rep.
Access to site analytics
Badges
3 58 93
Newest
 Nice Answer
Impact
~1.3m people reached

2h
comment Is there a way I can grep recursively over all the files in the current directory to find a pattern and then print it in order of high to low?
Sort does more things than you might be aware of, which you can learn more about by reading the man page. Try sort -t : -k 2,2n
2h
comment Is there a way I can grep recursively over all the files in the current directory to find a pattern and then print it in order of high to low?
Have you tried the sort command?
2h
reviewed Looks OK Unable to access iSCSI target since Targetcli has been updated on Centos 7
5h
comment Unexpected field expansion behavior by bash for loop
@JohnCarpenter The only thing for loops iterate over is words. It doesn't care whether those words were manually typed by someone or resulted from field splitting a normal variable or a bash array.
5h
reviewed Reviewed how to remove a RFL_SourceSumbission_20150901 - header .csv
5h
reviewed No Action Needed Tcl/Expect: Can't set variable value correctly
5h
reviewed No Action Needed How to determine callee function name in a script
5h
answered How to determine callee function name in a script
5h
reviewed Reviewed Unexpected field expansion behavior by bash for loop
5h
reviewed Looks OK Autostart under random WM?
1d
awarded  Nice Answer
Feb
1
awarded  Good Answer
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