Reputation
18,853
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
20 51
Newest
 Enlightened
Impact
~1.3m people reached

Apr
4
reviewed Close service that calls pm-hibernate when battery is low
Apr
4
comment sox in between two pipes
does sox understand that - is supposed to mean stdout? looks like it's being used to mean stdin. try /dev/stdout instead of the final -.
Apr
4
revised bash or Ksh quotes and command exec
added 3 characters in body
Apr
4
answered bash or Ksh quotes and command exec
Apr
4
comment bash or Ksh quotes and command exec
1. why do you need SERVICE to be read-only? 2. don't use \" when defining SERVICE, use single-quotes instead. 3. use double-quotes around $SERVICE when you use it on the slapd command line.
Apr
4
comment Writing a script that gives how much lines have “X” and “Y” in it?
you misunderstood what i said. Standard/POSIX awk has ARGV[]. GNU awk also has a getopt library (which is not required for what you are doing). ARGV[] is a pre-defined array that contains ALL of the script's arguments, same as $1 ... $9 etc in shell.
Apr
4
comment rename multiple files in multiple directories using Bash scripting
beat me to it. my version is almost identical except i used sed rather than ${file/sample/$name}, and i used $prefix rather than $name. +1
Apr
4
comment shortening a mv command to loop through multiple files
this is the fourth time you've asked the same question. rather than post a new question, edit your original question to clarify it. your last attempt ( unix.stackexchange.com/questions/273317/… ) had the most/best information, and you were on the right track with your file "containing a list of the new names". loop over that file and split it by =.
Apr
4
comment hard disks spin up by processes / applications that simply get a list of disks? How to prevent?
pretty nearly any access of most drives will wake them up from idle, even smartctl queries to check the temperature or check the idle state. yes, this is stupid. blame the stupid firmware in most drives. Note that constantly spinning a drive down and up and up again can wear it out, as most drives have a limited number of times they can be 'parked'. safer to just disable idle spindown entirely. e.g. see unix.stackexchange.com/questions/44103/…
Apr
4
comment Writing a script that gives how much lines have “X” and “Y” in it?
You can. I even gave you an example of how to do it in my first comment. searchseq=ARGV[1] in awk is equivalent to searchseq="$1" in sh. and delete ARGV[1] in awk removes the first arg, same as shift does in sh. GNU awk even has a library that provides getopt() for awk (with --long option capability as well as short options). See gnu.org/software/gawk/manual/html_node/Getopt-Function.html - but you don't really need getopt if you're just passing a single mandatory argument before the filename.
Apr
4
comment Pipe Fail (141) when piping output into tee — why?
on FreeBSD 10.2 with bash 4.3.42(0)-release, I get no output (neither hi, nor yo) except Missing name for redirect.. Exit code is 1 rather than 114.
Apr
4
comment Pipe Fail (141) when piping output into tee — why?
echo does not print its stdin. it prints its args from the cmd line. which doesn't explain why the hi isn't being printed or why you're getting a pipefail error code.
Apr
4
answered How can i extract data from this line?
Apr
4
comment Is it possible to use grep lookaroud multiple times?
if he's using perl, he can use one of the XML-parser perl modules that are available (either pre-packaged for his distro or from CPAN). regexps can't reliably be used to parse XML.
Apr
4
comment Is it possible to use grep lookaroud multiple times?
stackoverflow.com/a/1732454/137158
Apr
4
comment Internal fragmentation of a file
what is the touch file and bc file rather than just bc supposed to do?
Apr
4
revised Looking for a pattern with conditions
fixed spelling mistake
Apr
4
revised Looking for a pattern with conditions
added 116 characters in body
Apr
4
answered Looking for a pattern with conditions
Apr
4
comment Writing a script that gives how much lines have “X” and “Y” in it?
FYI, awk scripts can be in files with a #! /usr/bin/awk -f shebang, and have access to a pre-defined ARGV array (e.g. BEGIN { searchseq=ARGV[1]; delete ARGV[1]}. i.e. there's no need to wrap them in a shell script - unless the shell script does extra stuff outside of awk (which is usually unnecessary, because awk can do most of what the shell can do and a lot that the shell can't).