Reputation
3,082
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
6 20
Impact
~212k people reached

Mar
19
comment BASH getopts problem
Well when it comes to quoting, you should always quote in bash unless you really really know what you are doing: "Double quote" every literal that contains spaces/metacharacters and every expansion: "$var", "$(command "$var")", "${array[@]}", "a & b". Use 'single quotes' for code or literal $'s: 'Costs $5 US', ssh host 'echo "$HOSTNAME"'. See mywiki.wooledge.org/Quotes , mywiki.wooledge.org/Arguments and wiki.bash-hackers.org/syntax/words
Mar
19
comment BASH getopts problem
Well I'm not really sure if I understand the purpose though. Feel free to improve the answer and provide some examples which demonstrates the caveats
Mar
19
comment BASH getopts problem
By point 7, I mean that moznostm= seems to be pointless. If it was a variable holding an integer, then there are situations a variable should be initialized as 0 so you could start counting or do other arithmetic calculations. In the setting as it is now, I don't see how moznostm= is going to help.
Mar
18
revised BASH getopts problem
added 93 characters in body
Mar
18
reviewed Approve Kali Linux - Crunch - how to put @ symbol in the created list
Mar
18
answered BASH getopts problem
Mar
16
revised Strip #xxx comments except when they occur inside quotes in sed
added 2 characters in body
Mar
16
revised Strip #xxx comments except when they occur inside quotes in sed
higjlighting
Mar
13
comment Some characters disappear after processing a text file
Doing with the shell only would suffice while read -r addr; do echo "${addr}.html"; done < addresses.txt
Mar
12
comment Replace \n with blank in a file
Oh, It seems I've been missing something! Thanks for pointing it out. I'm just leaving the answer here so other will know how to NOT do it.
Mar
12
answered NginX + PHP-FPM displays blank php pages
Mar
12
reviewed Approve Displaying week's number in certain format using ncal or cal
Mar
11
reviewed Approve How can I use grep to search multiple unnested directories?
Mar
11
reviewed Approve Is there a way to have regular expression in ~/.ssh/config
Mar
11
reviewed Reject Keep a tally from a log file
Mar
11
revised Keep a tally from a log file
adding watch command
Mar
11
comment Keep a tally from a log file
First of all. grep has -c option to do the counting itself. Also when you substract $b from $a you do it in a math context, meaning the syntax becomes echo $((a - b))
Mar
11
answered Keep a tally from a log file
Mar
11
comment A sort of reversed cat
@Miline You now just need to substitute $2 with $1 and off you go!
Mar
11
answered A sort of reversed cat