Reputation
3,042
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
5 20
Newest
 Yearling
Impact
~192k people reached

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 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.
Apr
25
comment Formatting grep output with awk. Simple case and background case
What you need is mplayer Playing* 2>/dev/null | awk '/Playing/{print "Playing: " $0}' and you're done
Apr
25
reviewed Approve Why do I receive a “/bin/bash cannot find command” error for an alias?
Apr
24
revised Script not run with cron
Some grammer improvements
Apr
24
comment Script not run with cron
@Mercer answer your own question and let others know how it is solved. Spare me the effort!
Apr
24
comment Script not run with cron
@Mercer that is 0 4 * * * /opt/scripts/importData.py
Apr
24
comment Script not run with cron
@Mercer are you even reading my comments? You don't need the */1* .. Also remove bash .. You are not running a bash script. On top of your crontab put PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/scripts then the second line * * * * * /opt/scripts/importData.py
Apr
24
comment Script not run with cron
@Mercer Please show your crontab content. Also the error you're getting now.
Apr
24
comment Script not run with cron
@Mercer can you update your question and add the changes you made?
Apr
24
comment Script not run with cron
@Mercer Alright, so now try to add to crontab the line: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/scripts
Apr
24
comment Script not run with cron
@Mercer, The problem is the PATH variable which needs to be defined within cron explicitly. /opt/scripts is not in your path e.g echo "$PATH" won't show it. You can add e.g PATH=/opt/scripts:/usr/bin:/etc/etc/etc.... on top of the crontab and solve the problem. As a side note: */1 * * * * is equal to * * * * *