Reputation
3,002
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
4 20
Impact
~175k people reached

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
Mar
11
comment A sort of reversed cat
This is a typical useless use of cat If I understand the question, the OP want's the first field only. That'd be awk '{print $1}' Doc1.lst There is no need for cat. awk can read a file as well.
Mar
10
comment Replace \n with blank in a file
In awk you'd do something like: awk '{ gsub(/\\n/,"") }1' file Also quite funny you use hashes # as substitution delimiters.
Mar
10
answered Replace \n with blank in a file
Mar
10
revised Replace \n with blank in a file
added 22 characters in body
Mar
9
comment Push onto array with find exec
@AmadeusDrZaius This aproach does force read to use NUL byte as it's line delimiter. Since NUL is not a valid byte in unix filenames, this however is the safest place of feeding an array. See mywiki.wooledge.org/BashFAQ/020 for a better explanation.
Mar
9
answered Push onto array with find exec
Mar
5
comment Different Commands on Multiple Servers
If you have a file containing server addresses separated by a new line then you could probably use something as: i=0; while read -r server; do printf '%s %s\n' "./run$((++i))" "$server"; done < server_addresses. I'm not sure what your final goal is, but this should "hopefully" give you a clue.
Mar
5
comment rsync unexpected EOF in read_timeout
Have you tried to use quotes. e.g "$LOCAL_DIR" etc. Also does "${REMOTE_DIR}" variable contain a / slash? What do these variables look like?
Feb
27
reviewed Approve set tab width for less output
Feb
27
reviewed Approve Awk/sed command to cut on multiple delimiters