Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

3

One way to handle this is to set a variable, e.g. myPath, and build out from there. set myPath to POSIX path of (path to me as text) The myPath variable will be returned in the form of: /path/to/AppName.app/ You can then concatenate myPath and addition path segments and filename as needed. Note that when using this in a do shell script command, use ...


3

As you can see in your first screenshot, there is no application called and ‘kafka-‘. Therefore, it cannot look up its path. Try, for example, ‘which kafka-configs’ and it will show you the path.


3

I could not recreate what you have said is happening to you. Saying that I would say that: It is really very dangerous to invoke local as your alias Because the word local is a shell builtin, a reserved word for the default Bash shell to define a local variable in Bash script. If you do type local from a new terminal window after removing it from your ...


2

You can use ‘expect’ to enter the SSH password when prompted. Changes to your script are bolded. #!/usr/bin/expect -f spawn ssh root@server expect "*: " send "xxxxxxxxxxxxxx expect "$ " send "… commands spawn starts the command as normal, which in this case is SSH expect waits until the matching text is shown on screen send enters the text given, which can ...


2

I have created a AppleScript, that redirects all files dropped onto it, to a shell script with the matching name. Simply save as application from within Apple's ScriptEditor and rename as script.app to match your script.sh on getScriptName() tell application "Finder" set p to path to me -- alias to the file of the running script set ...


1

The only way I found to reproduce what you are seeing is if the symlink points to a non-existing file. So best to use ls -l to verify that all the symlink targets actually exist, and fix the links if necessary. More generally speaking: Unless you really need a specific version of python3 it might be better to just run cd /Users/dalemy/Projects/my_project/...


1

The variable IFS is used by various commands. The safest thing to do is save the value, then restore when finished. Below is an example. declare "IFS_BACKUP=$IFS" IFS=$' \t\n' read -p "Enter your command: " cmd arg1 arg2 IFS="$IFS_BACKUP" echo "$cmd" echo "$arg1" echo "$arg2" The documentation command man bash defines IFS as follows: IFS The ...


1

OK, turns out it's enabled be default so you have to disable it explicitly: Add the following line to the ~/.inputrc file: set disable-completion on


1

Use Startup Manager When you use Startup Manager to select a startup disk, your Mac starts up from that disk once, then returns to using the disk selected in Startup Disk preferences. Press and hold the option key immediately after turning on or restarting your Mac. Release the Option key when you see the Startup Manager window. If your Mac is protected ...


1

As I mentioned in my answer to your other question: Note that when using this in a do shell script command, use quoted form of to allow for spaces in the path filename. Otherwise you'd need to escape spaces with a backslash \, and that can get messy. Example: quoted form of appPath You might want to do the concatenation separately and then pass it to ...


1

I've reported this as an issue on Apple Communities and also reported it as a bug to Apple Support. Until it is fixed, there seems to be no workaround.


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