sell 进阶

删除shell函数:命令格式:unsrt function_name

创建函数:例

function func2 { echo fun2;}

 

fork  炸弹;:(){ :|&};:

脚本:

cat  Bomb.sh

#!/bin/bash

./$0./$0&

信号捕捉

trap ‘ehcho trap 15’ 15

for ((i=0: i<=100:i++)):do

echo $i

sleep 0.5

done

 

创建格子脚本

vim chess.sh

for i  in {1..8};do

for j in {1..4};do

if [$[i%2] -eq o ] ; then

echo -e “\033[1;42m \033 [0m\033[1;45 \033[0m\c”

else

echo -e “\033[1;45m \033 [0m\033[1;42 \033[0m\c”

fi

done

echo

done

 

生成随机字符;openssl  rand -base64

 

99乘法 脚本;

for i in {1..9} ;do

for j in seq 1 $i ;do

result=$[$j * $i]

echo -e “s{j} x $ {i}=$result\c”

done

echo

done

 

扫描 IP   vim scanip.shnet=某ip地址

for i in {1..254};do

{if ping -cl -wl |sum; $i &> /dev/null;then

echo $net . $i is up

else

echo $net.$i is down

fi;}

done

wait

 

QQ截图20180510210407

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/98090

发表评论

登录后才能评论

This site uses Akismet to reduce spam. Learn how your comment data is processed.

联系我们

400-080-6560

在线咨询:点击这里给我发消息

邮件:1823388528@qq.com

工作时间:周一至周五,9:30-18:30,节假日同时也值班