Skip to content

Tag: macos

Cross-Platform Installer paths

I’m writing an installer for a Python app I’m making, and needed to have paths for different file locations. These are what I have so far, and so wondered if these were correct of if I should change any of them (particularly the Linux/macOS ones) I have a path for: the actual binary for the config file the README the

npm ERR! code EACCES´╝î npm install –global yarn met error

Mac mini (M1, 2020) Monterey Brownie v1.17.2 nodejs v16.13.4 I am learning solidity according to reference( Node.JS install is fine when I tried this the terminal give the error information I checked the owner of the file ,the owner is root ,should i use sudo? find this thread (Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’),changed the owner , stll one file

How to adapt to Linux terminal back color in .NET 5/6?

We have a .NET 5 console application that runs on Windows/Linux/Mac. Our console application relies on the classic fore color scheme to highlight info/warning/error in console with fore colors gray/yellow/red. However we cannot gather the terminal back color as explained in Console.BackgroundColor documentation: Unix systems don’t provide any general mechanism to fetch the current console colors. Because of that, BackgroundColor

How to check password on macOS?

The following C program can check the password of a user on Linux. But it does not work on macOS because some functions are Linux specific. Could anybody show me how to revise the program so that it works on macOS? Answer Both Linux and macOS use PAM for authentication; Linux uses Linux-PAM, and MacOS and BSDs OpenPAM. To authenticate

Wait Until Previous Command Completes

I have written a bash script on my MacMini to execute anytime a file has completed downloading. After the file download is complete, the mac mounts my NAS, renames the file, and then copies the file from the mac to the NAS, deletes the file from the mac and then unmounts the NAS. My issue is, sometimes, the NAS takes

Copy a folder contents and save the file with diff name Unix

I have a bunch of .txt files in a directory. I m looking for a command to copy all .txt files and save it with <filename>_2.txt. Eg: abc.txt -> abc_2.txt (After copy) Thanks in tons in advance Answer EDIT: As per OP’s extension request adding following code now. Try following. Above will print cp commands, if you are ok with

Running bash script on multiple shells

So I was trying to create a script on bash shell, I came to know that the script doesn’t run on ksh or dash shells. So my question is how you make a script to run on all 3 (bash, dash & ksh) shells. Answer In order to write a script that is guaranteed to be portable between the various