Reputation
2,699
Top tag
Next privilege 3,000 Rep.
Cast close and reopen votes
Badges
4 18
Newest
 Student
Impact
~134k people reached

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
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.