shell - 我无法在终端中启动 shell 脚本文件,并且该文件不读取终端。我的 shell 脚本有问题吗?我该如何解决?
问题描述
shell脚本不能在终端打开,只能用TextEdit打开。当我尝试通过执行 cd、cmd、.sh 在终端中手动打开时,不幸的是它仍然无法打开。shell脚本是它的问题吗?我该如何解决这个问题?
这是 Photoshop 扩展的文件。
#!/bin/sh
set -e
cat << EOF
Photoshop extension Typer Tools v1.4.3 will be installed.
Close Photoshop (if it is open).
EOF
read -n 1 -p "Press any key to continue"
echo
SRCDIR=$(cd "$(dirname "$0")" && pwd)
is_preferences_domain_exists() {
defaults read "$1" > /dev/null 2> /dev/null
}
for version in {4..10}; do
if is_preferences_domain_exists com.adobe.CSXS.${version} ; then
defaults write com.adobe.CSXS.${version} PlayerDebugMode 1
fi
done
killall -u `whoami` csprefsd > /dev/null 2> /dev/null || true
DESTDIR="${HOME}/Library/Application Support/Adobe/CEP/extensions/typertools"
if [ -e "${DESTDIR}/storage" ]; then
cp "${DESTDIR}/storage" "${SRCDIR}/__storage"
fi
if [ -e "${DESTDIR}" ]; then
rm -rf "${DESTDIR}"
fi
mkdir -p "${DESTDIR}"
for item in app CSXS icons locale .debug; do
if [ -e "${SRCDIR}/${item}" ]; then
cp -rf "${SRCDIR}/${item}" "${DESTDIR}/${item}"
fi
done
if [ -e "${SRCDIR}/__storage" ]; then
cp -f "${SRCDIR}/__storage" "${DESTDIR}/storage"
rm -f "${SRCDIR}/__storage"
fi
cat << EOF
Installation completed.
Open Photoshop and in the menu click the following: [Window] > [Extensions] > [Typer Tools]
EOF
read -n 1 -p "Press Enter to continue"
echo
谢谢
解决方案
推荐阅读
- javascript - 使用 JavaScript 将 x em 添加到字体大小?
- azure-web-app-service - 登录页面包括“使用现有帐户登录”标题,然后为 Azure B2C 删除
- javascript - 可以从react js重复调用api吗
- android - 无法序列化 DslActivationStatus 状态...Android Studio
- python-3.x - 按季度平均分组并获取在平均计算中使用的值 -pandas
- git - 仅将具有历史记录的 TFS 存储库的一部分迁移到 Git azure devops
- javascript - 如何在 HTML5 中打开文件夹
- python - 你能解释一下 keras 模型中 tensorflow 加载和 hdf5 加载之间的区别吗
- postgresql - 在 Postgres 中将复合数组 UNNEST 成行和列
- c++ - 函数内的 C++2a 递归 lambda