your_id=${USER}-on-${HOSTNAME}
echo "$your_id"
your_id=`printf "%s%s%s" "$USER" "-on-" "$HOSTNAME"`
echo "$your_id"
echo "$your_id"
your_id=`printf "%s%s%s" "$USER" "-on-" "$HOSTNAME"`
echo "$your_id"
shell实现创建前一天时间的目录:
aaa=`date +%Y%m%d --date='1 days ago'`;
bbb="mkdir "$aaa
$bbb
bbb="mkdir "$aaa
$bbb
filename=$1
string1=exist
string2=xi
command="cat $filename | grep $string1 | grep $string2"
eval $command
string1=exist
string2=xi
command="cat $filename | grep $string1 | grep $string2"
eval $command
[~/shell]# sh test.sh runshell.sh
echo "exist;";
echo "notexist;";
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/3422/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2010-10-20 11:15
评论列表