Reputation
2,972
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
4 19
Newest
 Nice Answer
Impact
~156k people reached

Apr
29
comment kill: SIGSTOP: invalid signal specification error in bash script
Well according to posix specs, there is no SIG in sh. So again instead of commenting on every answer I post you better edit the answer and provide the right one. How's that?
Apr
29
revised kill: SIGSTOP: invalid signal specification error in bash script
added 251 characters in body
Apr
29
comment kill: SIGSTOP: invalid signal specification error in bash script
@user4757345 if that solved your problem, just modify the answer and add the explanation.
Apr
29
comment kill: SIGSTOP: invalid signal specification error in bash script
I see. Well probably because you need to enable posix mode? Are you on a Mac? set +o posix; kill -SIGSTOP 1234 could solve the problem as well!
Apr
29
comment kill: SIGSTOP: invalid signal specification error in bash script
Does the answer I posted illustrate the scenario? Do you still get the error? It should work interactively and as well as within a script.
Apr
29
answered kill: SIGSTOP: invalid signal specification error in bash script
Apr
29
comment kill: SIGSTOP: invalid signal specification error in bash script
You can use e.g trap 'kill -s SIGSTOP 1234' EXIT in a bash script. Also it is #!/bin/bash
Apr
29
comment Command to print users that don't have /sbin/nologin as a shell
@RomeoNinov Again, parsing ls output is not recommended. ls -l will also show the total bytes as the first field. Then the OP asks about files only and not folders,subfolders or files found in subfolders. Why you shouldn't parse ls output is explained here: mywiki.wooledge.org/ParsingLs
Apr
28
comment Command to print users that don't have /sbin/nologin as a shell
@RomeoNinov find might be an overkill but it is very accurate in checking directories. Parsing ls output is in general not Recommended.
Apr
28
revised Command to print users that don't have /sbin/nologin as a shell
adding explanation
Apr
28
answered Command to print users that don't have /sbin/nologin as a shell
Apr
28
comment bashrc lazy substitution
awk has a pattern space as well awk '/^Revision/{ print ...}' So no need for grep in this case.
Apr
28
comment mdoc warning: Empty input line #xx
What system are you running this command. Is this some *BSD system?
Apr
28
comment mdoc warning: Empty input line #xx
How are you searching man pages using grep?
Apr
28
revised Extract group name from `id` and store it in a variable
added 13 characters in body
Apr
26
comment dash: parse string into two variables
Oh my mistake. I didn't check that! Now I learned something! THanks
Apr
26
comment dash: parse string into two variables
echo doesn't survive the pipe. You can use Process Substitution to achieve what you want: E.g read -r X Y < <(echo "foo:123" | tr ':' ' '); echo "$X"
Apr
25
comment Longest/shortest Username in linux
Longest: awk 'length > longest_username { longest_username = length; longest=$0} END { print longest}' /etc/group Shortest: awk 'NR == 1 || length < length(shortest) { shortest = $0 } END { print shortest }' /etc/group
Apr
25
comment Formatting grep output with awk. Simple case and background case
@the_candyman there is no bash code in your example. You are using external commands player , grep , awk. You have problems with buffering. This page will explain everything about it: mywiki.wooledge.org/BashFAQ/009?highlight=%28unbuffer%29
Apr
25
comment Formatting grep output with awk. Simple case and background case
@G-Man why is the print wrong? And to solve his particular problem and if I had to remain in his way of thinking e.g mplayer *.* 2>/dev/null | stdbuf -oL grep "Playing" |awk '{print "Playing: " $0}' would do what he wants.