Reputation
2,972
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
4 19
Newest
 Nice Answer
Impact
~155k people reached

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
Feb
25
reviewed Approve Why doesn't manpage show the available options?
Feb
24
reviewed Approve PULSEAUDIO does not list my ALSA capture device as a capture source
Feb
23
reviewed Approve “error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file” while executing oald8 binary
Feb
19
reviewed Approve Difference between environment variables and exported environment variables in bash
Feb
18
reviewed Approve Screen corruption after hibernate — Is there another way to refresh the X11 display?
Feb
16
comment Loop for's result in a variable for sql query
Try the following: mywiki.wooledge.org/BashFAQ/001