Hot answers tagged

5

It's an interesting behavior you've noticed there. It's wrong to classify it as a "bug" because POSIX doesn't specify a -o option for grep. You may not like how it behaves, and I'll agree that it's annoying that BSD and GNU grep differ, but this behavior is not actually in conflict with what the BSD manual pages say. If you still say it's a bug, well, you ...


4

OS X in itself is a multi-tasking, multi-user OS, but VNC is desktop control software, so software that controls 1 desktop (unless set up in such a way that multiple virtual desktops can be controlled remotely). So what you're seeing is standard behaviour of the software you're using, not of the underlying OS... ;-)


3

Mac uses BSD ls. See man ls for details. The format of LS_COLORS is different. The variable name isn't even LS_COLORS, it's LSCOLORS. The links I found that were most helpful in figuring this out were this blog post, and this article which was linked to from the blog post. The default value for LSCOLORS is exfxcxdxbxegedabagacad. To leave everything at ...


3

Your problem comes from the ping command that never exits. You should make a loop that call ping for one test -c 1: while [ true ] ; do if ping -c 1 www.google.com | grep timeout ; then say fail ; fi ; sleep 1 ; done edit I wrote a bash while loop, may be you should adapt it to your shell program (It's been a long time I play with mac os X), I added ...


2

Regarding to above input examples the script can be: sed s/[^\"\']*[^0-9]\]{\(.*\)}/\1/ <<\END "[]{foo bar 1}" "[abc]{foo bar 2}" "[]{foo[3]{xyz} bar 3}" "[]{foo $sq[3]{xyz}$ bar 4}" "[goo{w}]{foo $sq[3]{xyz}$ bar 5}" "[goo[3]{w}]{foo $sq[3]{xyz}$ bar 6}" "[goo[3]{w} hoo[3]{5}]{foo $sq[3]{xyz}$ bar 7}" END produces "foo bar 1" "foo bar 2" ...


2

You can download the installer from https://www.python.org/downloads/release/python-2711/ and install it as usual: sudo installer -src /path/to/python.pkg -tgt / Alternately, you can use a Linux/BSD -like package manager, like Homebrew and install python from it: brew update brew install python


2

Being unable to change permissions as root on a built-in application or system file on OS X is indicative of System Integrity Protection, a new security feature added in 10.11, which restricts the root account and limits the actions that the root user can perform on protected parts of OS X. Protected parts include /System and pre-installed ...


1

HELP 1 Due to the whitespace you need quoting: INPUT= "${file##*/}" OUTPUT= "${file%.txt}"_exd.txt It seems a bit strange, though, that there is a space between INPUT= and the file name. HELP 3 If you have a file input_1.txt then ${file%.txt}_1.txt becomes input_1_1.txt. I would match the exact file name: for file in ~/Desktop/parent\ ...


1

Of course the answer is very opinion based, but I would go with Ubuntu (or any of its derivatives like Kubuntu) as it offers a huge community (e.g. at http://ubuntuforums.org/ or the askubuntu part of the stack network) that is really helpful. Also, many blog posts etc. deal with Ubuntu. As you are new to Linux, this is what you should look out for. On the ...


1

A rewrite to reduce duplication #!/bin/bash # Make script executable with: chmod u+x brew.sh # Ask for the administrator password upfront. sudo -v # Keep-alive: update existing `sudo` time stamp until the script has finished. while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Create '.other'-folder echo "--> ...


1

First: What do you need it for? Wouldn't sshfs do the job better? Your problem is the opposite. The server offers old (and possibly broken) KeyExchange methods: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1, that are no longer default in current version of openssh server (what is that server? If your sysadmin tells you that it is strict and ...


1

Locking scheme used for directory operations is based on two kinds of locks - per-inode (->i_mutex) and per-filesystem (->s_vfs_rename_mutex). When taking the i_mutex on multiple non-directory objects, we always acquire the locks in order by increasing address. We'll call that "inode pointer" order in the following. For our purposes all operations fall in ...


1

A common way to shuffle a list is to loop over the elements and swap with another element at random. #! /bin/bash - list=(1 2 3 4 5 6 7 8 9 0) random_list=("${list[@]}") n=${#random_list[@]} for ((i = 0; i < n; i++)); do (( r = RANDOM % n )) tmp=${random_list[i]} random_list[i]=${random_list[r]} random_list[r]=$tmp done printf '%s\n' ...


1

You should umount by the directory name , not the device name. man umount: The umount command detaches the mentioned file system(s) from the file hierarchy. A file system is specified by giving the directory where it has been mounted. Giving the special device on which the file system lives may also work, but is obsolete, mainly because it will ...


1

I know that this has already been resolved for OP, but for anyone stumbling upon this question, this seems to be a 10.11 El Capitan only problem. I tried and was able to delete files with this character in OS X 10.4 Tiger and OS X 10.10 Yosemite, so it very likely works on the other ones.



Only top voted, non community-wiki answers of a minimum length are eligible