Bash 课堂作业,但powershell和我有mac的说明,需要帮助转换
我不是编码员,但我在一个要求使用ms powershell的类中有一个作业,但我在Mac上。我已经猜出了宾巴什……某种程度上。我被要求写一个剧本Bash 课堂作业,但powershell和我有mac的说明,需要帮助转换,bash,macos,powershell,bin,Bash,Macos,Powershell,Bin,我不是编码员,但我在一个要求使用ms powershell的类中有一个作业,但我在Mac上。我已经猜出了宾巴什……某种程度上。我被要求写一个剧本 "`n" Echo "Hello Internet World! -- I am here" "`n" Echo "My Name is Norma and today is `r" Get-Date "`n" ECHO "As a net admin testing is an important part of the job" "`n" ECH
"`n"
Echo "Hello Internet World! -- I am here"
"`n"
Echo "My Name is Norma and today is `r"
Get-Date
"`n"
ECHO "As a net admin testing is an important part of the job"
"`n"
ECHO "You should check for IP information with ipconfig "
"`n"
ipconfig
Echo "You should check connectivity with ping"
PING www.google.com
ECHO "All done pinging google"
ECHO "This is a very simple program using windows powershell scripting"
我把它作为
#!/bin/bash
Echo Hello Internet World! -- I am here
Echo My Name is Dawn and today is $(date)
ECHO As a net admin testing is an important part of the job
ECHO You should check for IP information with ipconfig
ipconfig
Echo You should check connectivity with ping
PING www.google.com
ECHO All done pinging google
ECHO This is a very simple program using Mac bin bash scripting
但当我运行它时,它不会停止ping google.com。我如何才能让它停止,这样它将继续“所有完成ping谷歌”等
谢谢你的帮助 上面@jrider提供的链接包含在macPowerShell for Mac、Linux和Windows上安装PowerShell的完整说明
ping www.google.com-c4
这不是一个特别好的Powershell脚本。我希望它不是一个Powershell类。哈哈,哇,因为macOS有一个不区分大小写的fs,大写/mixcase命令实际上可以工作。作为一个有趣的副作用,它最终运行的是外部/bin/echo
,而不是bash的内置