The Stack Overflow podcast is back! Listen to an interview with our new CEO.
6

Always use man X directly on the Mac itself to see what is available for command X. The reason is that OS X was originally based on BSD and not GNU (most likely to avoid the GPL) so you should not follow Linux tutorials for MacOS.


5

Yes, you can do it, but it's a bit complicated. Permissions on macOS are rather complex; the Finder hides most of the complexity, but at the command line it's fully exposed and you have to deal with it. Really short answer: use chmod +a to add access control entries, ls -le to view them, and man chmod and man ls for details. Medium-length answer: to add (...


5

I solved the problem by granting Full Disk Access to /usr/bin/ruby as suggested here. Quoting from the reply, Emacs.app actually launches using a ruby script. As a result, MacOS Catalina uses the permissions set for ruby, not the permissions for Emacs.app. Grant access as follows. Go to "System Preferences -> Security & Privacy -> Privacy" Select ...


4

You can use pkgUtil for it. $ pkgutil --pkgs # list all installed packages $ pkgutil --files the-package-name.pkg # list installed files After visually inspecting the list of files you can do something like the following: I leave this up to you as modifying files with root user maybe a bit risky $ pkgutil --pkg-info the-package-name.pkg # check the ...


3

You need a space after vi and before the . so vi .bash_profile not vi.bash_profile. If you are not in your home folder you can also use vi ~/.bash_profile to specify the location as mentioned in ankiis answer below/above. Again you need a space after the vi. Alternatively, instead of using vi you can add your path to .bash_profileusing echo 'export PATH=/...


3

The 'last' command on a Mac has no -s option. Not all Unix commands are implemented the same on a Mac. Mac tends tends to use original BSD commands. As to why 's' isn't an option on the Mac, according to @Mark, it may be due to the difference in BSD (Mac) and GNU (Linux). There are most likely differences between the two.


2

I fixed issue by selecting the bash I want to use: System Preferences -> Users & Groups -> Advanced


2

Not directly modifying ctrl + W, but the same behaviour can be achieved using ESC + delete. Every time, escape key would have to be released and then pressed. Mac Terminal: Delete a word at time


2

Appending '\c' as per "man echo" documentation seemed to do this for me. So ... on line 9 the change would like below #!/bin/sh a=0 while [ "$a" -lt 10 ] # this is loop1 do b="$a" while [ "$b" -ge 0 ] # this is loop2 do echo "$b \c" b=`expr $b - 1` done echo a=`expr $a + 1` done


2

The traditional UNIX way of preventing a program from having multiple copies running is with a .pid (or lock) file. The following example appears on multiple places: #!/bin/sh NAME=$(basename "$0") if [ -f /var/run/"$NAME.pid" ] && ps -p $(cat /var/run/"$NAME.pid") >/dev/null 2>&1 then echo "Script is currently in progress... ...


2

It is not your command line tools which are failing. Quite obvious, this is a compiler error and it seems like the python library was developed against a different set of headers - the compiler merely states a mismatch. So gcc is working as expected - the python library‘s C extension is outdated. I fear there is little you can do aside from what you ...


2

That's the "base" environment from Anaconda or Miniconda. It means the Python environment from conda is enabled by default. There're two solutions. Just disable the base environment, make sure your conda >= 4.6. Whenever you wanna use Python, enable an environment from conda manually with following command, # run this in an interactive shell # enable ...


1

Run /usr/bin/vim ~/.bash_profile and fix whatever is wrong in the assignment to PATH.


1

If you want to make sure you only remove the symlinks created you can run cd /usr/local/include rm $(cd /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/; echo *) This does not work if the filenames contain spaces etc., but for this specific case this isn't an issue.


1

Inspired by How to delete files from a specific date?: # Create a marker touch -t 201910190000.00 /tmp/PID$$.marker1 # View the files you would like to delete find /usr/local/include/ -type l -newer /tmp/PID56680.marker1 -ls | less # Delete them find /usr/local/include/ -type l -newer /tmp/PID56680.marker1 | xargs rm -f


1

Running the following commands in macOS Catalina 10.15: sw_vers ProductName: Mac OS X ProductVersion: 10.15 BuildVersion: 19A602 zsh --version zsh 5.7.1 (x86_64-apple-darwin19.0)


1

This particular behaviour have nothing at all to do with any "impossibility" of redirecting subprocess stderr on macOS. It is not impossible, and works like you would expect - i.e. similar to Linux and FreeBSD. The gotcha here is that you're using different PHP configurations on those setups. It seems you're not using the stock supplied PHP, but rather ...


1

Some users who are new to the Mac will find it easier to edit their bash_profile file directly in their favourite text editor rather than via Terminal. Yes, it's slower ... but can be easier for newbies to understand what's going on and diagnose errors. Here are the steps. Open Finder and from the menu at the top select Go | Home. Sort the files in your ...


1

This is caused by the Privacy features introduced with macOS Mojava and expanded with macOS Catalina. Essentially apps are sandboxed and not allowed to access the full disk, unless you give them that permission. You can give an application access to the full disk like this: Open System Preferences Click Privacy & Security Choose the Privacy tab Select ...


1

If until now you've been using ~/.bash_profile for the loading the aliases, here are some of the ways you can migrate your aliases: 1. Copy the contents: The most assiduous and obvious way is to copy the contents of your ~/.bash_profile to ~/.zshrc. It works particularly when you are moving on from bash to zsh for good. 2. Pull out aliases and then ...


1

Firstly, update the local formula repositories to the latest state. Cause reading issues on GitHub repo Hombrew-cask, the error may be introduced by typos in formula definitions. # enable --verbose to get more info brew update --verbose Then try brew search metabase again. If the above command doesn't fix your problem, go into local repository of ...


1

Bash profile can be reached at ~/.bash_profile. I don't use vi, but nano ~/.bash_profile works. Hope vi is similar too.


1

Why my httping package is unlinked? No one knows, it's your machine. We don't know what you have done in the command line. To fix the unlinked kegs error, run the following command to relink it manually, brew unlink httping brew link httping # if it doesn't link, force link it brew link --overwrite httping Why a Homebrew package need to be linked? Take ...


1

Now I have a solution that works for me. If I put the content of the routen_VPN.sh in Automator in AppleScript like this do shell script "content of routen_VPN.sh" with administrator privileges it works fine. Thanks to all who tried to help me with this! :-)


1

Given your example, and assuming the example holds true, then the example bash code, shown further below, should work. The following Automator workflow uses the Find Finder Items action, as you have it, but then uses a Run Shell Script action directly after, as there doesn't seem to be a need for a Set Value of Variable action as shown in your OP. On the ...


1

I'd try with a script using the following outline sudo nvram -c which should clear the contents of NVRAM. curl 'https://sourceforge.net/projects/refind/files/0.11.4/refind-flashdrive-0.11.4.zip/download' --output refind.usbimage copy SmcFlasher there (https://discussions.apple.com/thread/4855319?answerId=22024754022#22024754022) shutdown -r now and ...


1

Fabio Viola use this command : sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" 'UPDATE access SET allowed = "1";' 1 is for granting access and 0 is for declining access. I hope this may work.


1

First locate the sqlite files db and db-wal where notification reside. As in mojave, could be found using this command: lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $9 }' | grep 'db2/db$' | xargs dirname Then as @greenhouse mentioned, MacFronsics script is good choice to parse db file. As far as I test the script supports ...


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