2 Star 4 Fork 2

晴云孤魂/shell-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ucase.sh 467 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
# ucase、lcase快捷函数:
#借助Perl转换字符串为大写或小写
ucase() {
#借助Perl转换所有字符串中的字母为大写
if [ -t 0 ];then
#echo "无管道输入"
clip1|perl -lpe 's/^.*$/\U$&/'
else
#echo "有管道输入"
perl -lpe 's/^.*$/\U$&/'
fi
}
lcase() {
#借助Perl转换所有字符串中的字母为小写
if [ -t 0 ];then
clip1|perl -lpe 's/^.*$/\L$&/'
else
perl -lpe 's/^.*$/\L$&/'
fi
return
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hexiyou/shell-scripts.git
git@gitee.com:hexiyou/shell-scripts.git
hexiyou
shell-scripts
shell-scripts
master

搜索帮助