Watermelon Bash Mac OS

broken image


Introduction

When you started using Mac OS in first time, you would find that zsh was installed by default instead of bash in terminal.

Mac OS X Hints By Rob Griffiths, Senior Contributor Feb 19, 2010 4:50 am PST Today's hint is for those of you who, like me, use Terminal often and occasionally have a need to do things there as. The Watermelon Bash will be located just outside of Town Hall at: 305 Queen Anne St, La Plata, MD 20646 Remember — it takes place on July 4th so save the date!

I am more familiar with bash, so I have more scripts executed by bash, even if zsh and bash are both scripting languages, there is no guarantee that zsh can execute them.

  1. In bash, use $OSTYPE and $HOSTTYPE, as documented; this is what I do. If that is not enough, and if even uname or uname -a (or other appropriate options) does not give enough information, there's always the config.guess script from the GNU project, made exactly for this purpose.
  2. When I worked on Mac OS X in the lab I was able to get the terminal colors from using Terminal (rather than X11) and then editing the profile (from the Mac menu bar). The interface is a bit odd on the colors, but you have to set the modified theme as default. Further settings worked by editing.bashrc.
Watermelon

So, let's introduce how to replace the zsh preset in the terminal!

Use terminal to change script language

First, we can check which scripting languages are supported in the system.

Btr dating sim prototype mac os. Output:

It can be found that there are actually many options besides bash.

Then, if we change zsh to bash, we can use the chsh command.

We can see that the original terminal displays zsh:

After reopening, it will be displayed as bash.

Mac Os Catalina

Sky outbreak mac os. Of course, in addition to operating in the terminal, we can also replace bash in the setting interface.

Watermelon Bash Mac OS

So, let's introduce how to replace the zsh preset in the terminal!

Use terminal to change script language

First, we can check which scripting languages are supported in the system.

Btr dating sim prototype mac os. Output:

It can be found that there are actually many options besides bash.

Then, if we change zsh to bash, we can use the chsh command.

We can see that the original terminal displays zsh:

After reopening, it will be displayed as bash.

Mac Os Catalina

Sky outbreak mac os. Of course, in addition to operating in the terminal, we can also replace bash in the setting interface.

Use the system preferences to change the script language

click apple icon in the upper right corner => System Preferences => Users & Groups => Click the lock to make changes => Right click on the account => Advances Options => switch login shell

This can also switch the script language used by the terminal.

References

Maybe you want to read:

Can we set up global ADB on Mac by adding ADB variable environment? I had this question in mind while writing a tutorial on setting up system-wide ADB and Fastboot on Windows. 'ADB command not found' is a common issue for Android users trying to run ADB commands on Mac. Fortunately, there's an easy way to add ADB to a path on Mac by setting up PATH variable in bash profile and enable universally present ADB and Fastboot.

Besides, there's another trick that involves dragging the ‘Platform-tools' folder to the Mac Terminal. By doing so, you can immediately trigger ADB and Fastboot and start using commands without adding the folder path manually.

Once you have set up global ADB and Fastboot by adding ADB or Platform-tools to a path via a Bash profile in the Mac Terminal, you'll be able to run ADB commands from any screen.

Set up ADB Path in Mac Terminal Bash Profile

If you want to enjoy global access to the ADB and Fastboot command-line tools right after launching the Mac Terminal, follow the steps described below. Papageno mac os.

  1. Download the latest Android SDK Platform-tools that contain ADB and Fastboot drivers for Mac. Extract the downloaded zip to get a folder named ‘platform-tools‘.
  2. Now open the Home directory on your Mac. If you don't know how to do that, there are 3 ways to open it.
    • Press Command+Shift+H on your keyboard.
    • Press Command+Shift+G and enter ‘~/'.
    • Double-click the Macintosh HD icon on your desktop. Now click Users > Home icon.
    • Click on the Go tab in the Finder bar and select Home.
  3. Create a new folder called ‘android-sdk-macosx‘ in the Home directory. You can rename it as ‘ADB' or ‘AndroidSDK' too if you want.
  4. Now, right-click on the ‘platform-tools‘ folder icon and select the Copy 'platform-tools' option from the context menu.
  5. Paste the ‘platform-tools‘ folder in the new folder you created. You can move this folder to any other location where you won't accidentally delete them. I moved it to the root of my Macbook Pro's storage.
  6. Launch the Mac Terminal app from Finder > Go > Utilities.
  7. When the Terminal is open, type the following command given below and press the Enter key. In order to avoid typo mistakes, you can simply copy and paste the command into the Terminal window. Just make sure to use the correct path of the ‘platform-tools‘ folder in the command line. You can easily copy the folder path on Mac using the tips in my guide.
  8. In case you moved ‘platform-tools' to the Home directory, you can use the following command after replacing username with yours.
  9. Now that the ADB PATH variable has been added to your bash profile, you need to reload it using the following command. Alternatively, you can just close the Terminal window and re-launch it.
  10. If you want to check the current value of the PATH variable, you can use the following command. Otherwise, just skip to the next step.
  11. Since you have already added ADB to Path on your Mac, you can start using ADB or Fastboot commands. It's time to verify that you have set up ADB properly on your Mac. Just type adb or adb devices in the Terminal and hit the Enter key.
  12. In case you get the ‘adb: command not found‘ error on your Mac, you might have made some mistake. Try the steps given above again more carefully.

Add Terminal Shortcut to Platform-Tools

Finally, here's the easiest method to add any folder path to the Mac terminal. Just follow the tip described below to get rid of typing the ‘platform-tools‘ folder path in the Mac Terminal every time you have to use ADB and Fastboot commands. It doesn't provide a global or system-wide ADB support as the above method does.

Bash On Mac

  1. Open System Preferences on your Mac.
  2. Click on Keyboard.
  3. On the next screen, click on Shortcuts and select Services from the left pane.
  4. Now, look for Files and Folders in the right pane and enable New Terminal at Folder.
  5. The shortcut will be added to the folder context menu. You can close the System Preferences window.
  6. Just right-click on the ‘platform-tools‘ folder icon and select the New Terminal at Folder option.
  7. When the Terminal window is launched, you can run any ADB and Fastboot command directly without typing the folder path.

Watermelon Bash Mac Os X

If you want to learn more about ADB and Fastboot, read my tutorial describing some more ways to install ADB on Mac. You should also check out these ADB Shell commands and other stuff that you can do on your Android device with ADB.





broken image