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 ...
随机推荐
- DeepFM: A Factorization-Machine based Neural Network for CTR Prediction (2017)论文要点
论文链接: https://arxiv.org/pdf/1703.04247.pdf FM原理参考: Factorization Machines with libFM 论文阅读 https://w ...
- 第五章 动画 50 动画-transition-group中appear和tag属性的作用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- eclipse编码格式(中文乱码)
https://jingyan.baidu.com/article/2009576193ee38cb0721b416.html 修改工作空间默认编码 1 进入Eclipse,导入一个项目工程,如果项目 ...
- 我所亲身经历的CMMI3 [问题点数:20分,结帖人outer2000]--转载
很荣幸,作为某公司软件部门的软件项目经理,亲身经历了CMMI3,以下就把整个改进过程,用自己的亲身体会,详述如下,文中一些观点与看法难免带有个人感情,还请各位酌情参考. 公司情况简单介绍下,因为是为某 ...
- JAVA》eclipse——(三)jsp学习
导出一个war包
- php的$_get,$_post用法
$_GET 可以被收藏, 可以被缓存, 可以保存在历史记录中, 可以提交请求但是很不安全, 长度有限制在2000个字符,其实get请求就是一个url;$_GET['user_name'] $_POST ...
- 第十一章 前端开发-html
第十一章 前端开发-html 1.1.0 html:超文本标记语言 html特征:(HyperText Markup Language) 对换行的空格不敏感 空白折叠 标签:有称为标记 双闭合标签 & ...
- 字符串分割SplitString
C/C++中常用的字符串切割函数有strtok.strtok_s与strtok_r. 1.strtok函数 char* strtok(char* str, const char* delim); 分解 ...
- mybatis-plus-generator 实践
package com.huixiaoer.ant.generator; import com.baomidou.mybatisplus.annotation.DbType; import com.b ...
- 如何查看 SQL Server 执行的历史 SQL 语句记录?
SELECT st.text as sql_statement, qs.creation_time as plan_last_compiled, qs.last_execution_time as p ...