Unix & Linux Weekly Newsletter
Unix & Linux Weekly Newsletter

Top new questions this week:

Why is using a shell loop to process text considered bad practice?

Is using a while loop to process text generally bad practice in POSIX shells? As St├ęphane Chazelas pointed out, some of the reasons for not using shell loops are conceptual, reliability, legibility, ...

/ shell / text-processing  
asked by cuonglm 28 votes
answered by Stéphane Chazelas 39 votes

What does `kill -0` do?

I recently came across this in a shell script. if ! kill -0 $(cat /path/to/file.pid); then ... do something ... fi What does kill -0 ... do?

/ kill  
asked by slm 28 votes
answered by slm 44 votes

Why is coreutils sort slower than Python?

I wrote the following script to test the speed of Python's sort functionality: from sys import stdin, stdout lines = list(stdin) lines.sort() stdout.writelines(lines) I then compared this to the ...

/ python / performance / sort / coreutils / benchmark  
asked by augurar 15 votes
answered by augurar 13 votes

How can variables use "~" for cd'ing?

How can I use a variable - $BASE in my cd. I tried the following but I get an error $ cd ~/z/repo_1_ruby_193/ 23:23:57 durrantm Castle2012 /home/durrantm/z/repo_1_ruby_193 $ BASE="~/z" 23:24:03 ...

/ bash / shell / quoting / variable  
asked by Michael Durrant 12 votes
answered by jw013 23 votes

Start a process on a different tty

After about an hour of Googling this, I can't believe nobody has actually asked this question before... So I've got a script running on TTY1. How do I make that script launch some arbitrary program ...

/ bash / tty  
asked by MathematicalOrchid 11 votes
answered by wurtel 11 votes

Security implications of running perl -ne '...' *

Apparently, running: perl -n -e 'some perl code' * Or find . ... -exec perl -n -e '...' {} + (same with -p instead of -n) Or perl -e 'some code using <>' * often found in one-liners ...

/ security / perl / filenames / options  
asked by Stéphane Chazelas 11 votes
answered by Stéphane Chazelas 13 votes

How can I shutdown a RHEL server at 06:45 tomorrow morning?

I just received notification that our site has a power outage tomorrow morning. I am a Windows admin but I have to cover for our Linux admin who's not around until tomorrow evening. I need to ...

/ linux / command-line / rhel  
asked by user4166144 9 votes
answered by jmunsch 11 votes

Greatest hits from previous weeks:

How can I get my external IP address in bash?

I need to find my external IP address from a bash script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it depends on ...

/ linux / bash / ip  
asked by eugene y 52 votes
answered by Krinkle 53 votes

How to change hostname on centos 6.5?

Hi can't seem to change the hostname on my centos 6.5 host. I am following the instructions I found here: http://www.rackspace.com/knowledge_center/article/centos-hostname-change I set my /etc/hosts ...

/ centos / hostname  
asked by Red Cricket 3 votes
answered by Networker 7 votes

Can you answer these?

Alternative to the Linux Mint Cinnamon display settings?

I have Xubuntu on a computer and I like very much the way the display settings manager (xfce4-display-settings) handles external display etc. -- Especially the minimal view is great (looks similar to ...

/ linux-mint / xfce / cinnamon / display-manager  
asked by cipricus 1 vote

TFTP put works with files in pwd but fails with absolutely pathed filenames

The following command works as expected: tftp <tftp_server_name> -c put some_file However, the following command fails: tftp <tftp_server_name> -c put /absolute/path/to/some_file ...

/ debian / file-server / tftp  
asked by lepubel 1 vote

ulimit logging?

When a user/process hits a ulimit is there a way to log this at the system level? I cannot find any logging information in /var/log/messages, or dmesg. I did some preliminary research and the answer ...

/ logs / ulimit  
asked by josten 3 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3