Reputation
19,203
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
21 55
Impact
~1.3m people reached

Apr
12
comment What does SAMBA use /tmp for?
perhaps so, but randomly changing and disabling things you don't understand is never a good idea. BTW, by "something less restrictive", i hope you meant "back to what it was, chmod 1777 /tmp".
Apr
12
awarded  Curious
Apr
12
comment Iterating over multiple-line string stored in variable
for example: with that input data, cat <<< "$variable" | wc -l returns 5. cat <<< $variable | wc -l returns 1. If you want/need to preserve whitespace (including newlines, tabs, single or multiple spaces) in a variable then you MUST double-quote the variable when you use it, otherwise they'll all be transformed into a single space between each "word".
Apr
12
comment Iterating over multiple-line string stored in variable
The variable=$(cat quickfox) in the OP's question itself provides an example of what I was talking about. Using that $variable inside double-quotes includes the newlines, using it without has the newlines translated to spaces by the shell. If you're reading and processing line-by-line, this makes a huge difference - with the former you have multiple input lines, with the latter you have just one input line. The input data is superficially similar but, in practice, completely different in those two cases.
Apr
12
reviewed Close How to access the node created in user space from kernel?
Apr
12
reviewed Close view stdout for another pts
Apr
12
reviewed Leave Closed Where I have to move a file in order to have it not be accessible via my webserver?
Apr
12
comment How do I get a yum repo to work in a Docker container?
just out of curiosity...are you in a "devops team"? and are you the programmer dumped with all the sysadmin type jobs so that your employer doesn't have to waste good money on hiring a sysadmin? if so, tell your boss that devops isn't supposed to work like that. also tell him to hire an actual sysadmin.
Apr
11
comment Iterating over multiple-line string stored in variable
you need to double-quote $variable when you use it, otherwise the while loop will get only one line of input. See, for example, the difference in output between echo $variable vs echo "$variable" or cat <<< $variable vs cat <<< "$variable".
Apr
11
comment How do I automate to display cursor under the prompt on shell
I optimise for both space and readability. In a terminal, excess newlines detract from readability by requiring me to use the scrollbar/scroll-keys more often.
Apr
11
comment How do I automate to display cursor under the prompt on shell
Whether you use an <= 80-column terminal or a more sensible 132+ columns, what i said is still true - screens are wider than they are tall. even old-fashioned screens used a 4:3 aspect ratio. BTW, my terminal is currently 192x51 lines and I'd still never waste valuable vertical screen space by printing unnecessary newlines in every prompt...i wouldn't do it even if my terminal was 100 or more lines high.
Apr
11
answered Setting a disk space quota on a samba share residing on an ZFS pool
Apr
11
answered How do I automate to display cursor under the prompt on shell
Apr
11
revised how to fetch lvm mount point (generic)
improved to add counter for logical volumes
Apr
11
revised how to fetch lvm mount point (generic)
improved to add counter for logical volumes
Apr
11
answered how to fetch lvm mount point (generic)
Apr
11
comment How can I get my bash script to remove the first n and last n lines from a variable?
There's way too much to explain properly here in a comment, and it would be off-topic for this site. DNS is only tangentially related to unix & linux.
Apr
11
comment How can I get my bash script to remove the first n and last n lines from a variable?
For example: example.com would be the domain. it can have NS, A, SOA, TXT, and some other records. it can NOT have a CNAME. mail.example.com is a hostname within example.com. It can have A, CNAME, TXT and/or other records - but if it has an NS record then it is a sub-domain of example.com. if a DNS record is a CNAME then it can have NO OTHER records, it's just an alias pointing at some other hostname. This is a gross simplification, you really need to read DNS & BIND (shop.oreilly.com/product/9780596100575.do) or some other reference book on DNS.
Apr
11
comment How can I get my bash script to remove the first n and last n lines from a variable?
host can fetch any type of DNS resource record, but you need to remember that a domain has SOA and NS and some other records (including A and TXT) but can not be a CNAME (that would make no sense at all). A hostname within a domain can be a CNAME record, but not the domain itself.
Apr
11
revised How can I get my bash script to remove the first n and last n lines from a variable?
got rid of `-i` on first two sed examples. doesn't do anything when processing stdin.