ubuntu中写sh脚本
- 批量执行命令
sh findpcap.sh
sh extractor.sh
- 脚本入门
- 脚本传参
sh main.sh ~Downloads/pcap ~/Downloads
- 字符串处理
sh test.sh $str
var='/home/mason/Downloads/pcap/data/skyeu/skypeu.pcap'
$: echo ${var#*/}
$: home/mason/Downloads/pcap/data/skyeu/skypeu.pcap
$: echo ${var##*/}
$: skyeu.pcap
- 遍历文件夹下
for var in $1/*
do
echo ${var}
done
- 脚本运行应用程序
#!/bin/sh
cd /Applications/finalshelldata/
./start
- 合并字符串输出
var1='skyeu'
var2='flows'
echo ${var1}_${var2}.txt
ubuntu中写sh脚本的更多相关文章
- Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。
在Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- 在Linux中执行.sh脚本,异常
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- 在Linux中执行.sh脚本,异常/bin/sh^M
在Linux中执行.sh脚本,异常/bin/sh^M 在linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分 ...
- 使用shell程序备份crontab中的.sh脚本文件
需求 线上环境有一些定时脚本(用crontab -l可查看当前用户的),有时我们可能会改这些定时任务的脚本内容.为避免改错无后悔药,需用shell实现一个程序,定时备份crontab中的.sh脚本文件 ...
- ubuntu中编写shell脚本开机自动启动
编写脚本是为了不用手动去开启各种服务(也是为了偷懒哈哈) 1.进入终端输入 创建一个后缀为.sh的脚本文件 touch test.sh 编辑脚本 vim test.sh test.sh编写脚本内容 ...
- ubuntu中写一个shell脚本的过程
gedit hello.sh ,然后输入 #!/bin/bash echo "Hello world!" chmod +x hello.sh ./hello.sh
- ASP.NET aspx页面中 写C#脚本; ASP.NET 指令(<%@%>);
1 <h2>Welcome</h2> <ul> <% for (int i = 0; i <= Convert.ToInt32(ViewData[&qu ...
- ubuntu中运行python脚本
1. 运行方式一 新建test.py文件: touch test.py 然后vim test.py打开并编辑: print 'Hello World' 打开终端,输入命令: python test.p ...
- python 中写hive 脚本
1.直接执行.sql脚本 import numpy as np import pandas as pd import lightgbm as lgb from pandas import DataFr ...
随机推荐
- nginx搭建及加固
系统使用的是centos7 Nginx安装及配置 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务 安装 我是用的环境是ce ...
- RWD(Responsive Web Design)(转)
The key point is adapting to the user’s needs and device capabilities. Suppose a mobile user will be ...
- 分布式中 CAP BASE ACID 理解(转载)
概念理解(CAP,BASE, ACID) CAP CAP: Consistency, Availability, Partition-tolerance 强一致性(Consistency).系统在执 ...
- tomcat9.0 问题汇总
安装时提示 Failed installing tomcat9 service 是因为之前安装tomcat,然后直接删除文件夹,虽然把文件夹删除了,但是重新安装时,服务存在相同的服务名,解决办法:使用 ...
- qt5--QPainter绘图
需要 #include <QPainter> #include "win.h" #include "ui_win.h" #include <Q ...
- LINUX学习之一基础篇
1.计算机硬件五大单元:运算器.控制器.存储器.I/O设备 2.CPU种类:精简指令集(RISC)和复杂指令集(CISC) 3.1Byte=8bit,扇区大小为512bytes 4.芯片组通常分为两个 ...
- Attention机制中权重的计算
Attention mechanism中,给输入序列中对应的每一个Ht分配权重(打分)究竟是如何打分? 输入序列打分,a(s, h) 其中s是输出序列的t-1时刻的隐藏层状态,h是输入的多个状态,
- Array数组对象方法
Array 对象方法 方法 描述 concat() 连接两个或更多的数组,并返回结果. copyWithin() 从数组的指定位置拷贝元素到数组的另一个指定位置中. entries() 返回数组的可迭 ...
- ES6 Promise使用介绍
1.什么是Promise Promise 是异步编程的一种解决方案,比传统的解决方案——回调函数和事件——更合理和更强大. 这么说可能不够直观的理解,看下面的两个例子 // callback回调函数 ...
- 【Java基础】谈谈集合.List
摘自:https://www.cnblogs.com/54chensongxia/p/11722828.html 目录 1. ArrayList 1.1 ArrayList的构造 1.2 add方法 ...