Covert bash script to zsh.

I have just upgraded from Mojave to Big Sur.

Need some script advice.


I have a script for bash. Need some help to convert this to zsh.


bash version :

#!/usr/bin/env bash
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users:/Users/root:/Users/root/Scripts:/Library/Scripts:/Library/Scripts/Startup
#Load modules for Fuse
/Library/Filesystems/macfuse.fs/Contents/Resources/load_macfuse
/usr/sbin/sysctl -w vfs.generic.macfuse.tunables.allow_other=1
#Connect to rsync_net
/bin/sleep 45
/usr/local/bin/sshfs XXXXX@XXXX.ch-s011.rsync.net: /Volumes/rsync.net -olocal,auto_cache,reconnect,volname=rsync.net,allow_other,defer_permissions,async_read


And here is another one that I would like to convert :

I have the following in my .bash_profile :

#Setting PATH for meson and ninja
export PATH=$PATH:/Users/tormod/Library/Python/3.9/bin
#Setting PATH for Python 3.9
PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
export PATH


What is the corresponding for a zsh profile ? .zprofile ?







Posted on Nov 20, 2021 3:11 AM

Reply
18 replies

Dec 14, 2021 8:30 AM in response to VikingOSX

This is my actual script ( I had pasted incorrectly ) :


myip=0
while [ $myip = 0 ]
do
/bin/sleep 13
myip=$(ifconfig -l | xargs -n1 ipconfig getifaddr)
done
/usr/local/bin/sshfs xxxxx@xxxxx-s011.rsync.net: /Volumes/rsync.net -olocal,auto_cache,reconnect,volname=rsync.net,allow_other,defer_permissions,async_read


I find that the loop will not run, and if the sleep time is not long enough than the sshfs will not run at all.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Covert bash script to zsh.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.