Reputation
2,040
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
6 10
Newest
 bash
Impact
~43k people reached

2d
comment BASH: bash completion function in a custom script
but the user's shell needs to know about the completion before the script executes, so the completion code cannot be bundled into the script. You need to get the user to source some initialization script that contains the completions
2d
comment BASH: bash completion function in a custom script
Do you mean you want to put the completion code inside test.sh, and you want to have tab completion like ./test.sh foo<tab> ? Or do you mean that test.sh implements a command-line interface for which you want to enable completion?
Apr
14
comment convert for loops to while loops comparing arrays
I'm not surprised: I clearly can't test it.
Apr
14
answered convert for loops to while loops comparing arrays
Apr
14
comment convert for loops to while loops comparing arrays
Is there a specific problem you're having, or are you trying to assuage a sense of vague unease? (I'm not being sarcastic, this is a real question)
Apr
14
comment use awk to execute logrotate command when disk is full
You seem determined to not understand what I wrote: @daily df -P /dev/sda2 | tail -1 | awk '$5 > 90 {system("logrotate -vf /etc/logrotate.d")}'
Apr
12
comment use awk to execute logrotate command when disk is full
No. you need the quotes as shown. Cron is not that magical that it changes how awk works.
Apr
10
answered use awk to execute logrotate command when disk is full
Apr
2
comment What is the difference between setting the environment variables in these 2 ways?
Note that if your shell is /bin/sh, that shell may not support the export var=val syntax. You may have to write var=val; export var. The main difference is that the first only export the variables for nginx and its children; the second will make the vars available for any process that shell spawns.
Mar
23
answered Can I get an array as an option argument in bash script
Mar
11
revised Why don't random numbers in AWK change after the first run?
added 8 characters in body
Mar
10
answered bash variables: expanding the values of variables whose names match a pattern
Mar
2
revised How to make a simple script that increases a number character by 1
formatting
Mar
2
suggested approved edit on How to make a simple script that increases a number character by 1
Mar
2
comment Should I be adding aliases to /etc/profile instead of /etc/basrhc?
Yes, see the bash manual, gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
Mar
2
answered Should I be adding aliases to /etc/profile instead of /etc/basrhc?
Feb
9
answered Manipulate JSON in bash
Feb
8
awarded  bash
Feb
7
answered Command fails during script execution in bash
Jan
12
comment Catch all emails and pipe them all to a script with postfix
this sounds like a job for procmail