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 ...
随机推荐
- 【hdu 6071】Lazy Running
菜鸡永远都在做着变聚的梦. 题意 有 \(4\) 个点连成一个环,连接顺序依次为 \(1-2-3-4-1\).相邻两个点之间有个距离 \(d_{i,i+1}\)(特别地,当 \(i=4\) 时为 \( ...
- Spring-data-jpa操作数据库环境配置
application.xml文件 <?xml version="1.0" encoding="UTF-8"?><beans xmlns=&q ...
- 1.shell编程-变量的高级用法
1.1.变量替换 变量替换的六种形式 实例:非贪婪和贪婪的区别 从头部删除 [root@VM_0_9_centos shell_learn]# var_1="i love you,do yo ...
- ffmpeg函数05__vcodec_decode_video2()
vcodec_decode_video2()的作用是解码一帧视频数据
- 结束&新的开始。
我退役啦. 真的很抱歉,但我的学习周期还是太长了,没能在noi之前让自己变得足够强啊. FareWellOi.虽然很舍不得,但总要告别对吧. 相比竞赛的跳跃性钻研性学习,我的优势在于系统性学习.所以我 ...
- "TypeError: handler.call is not a function"问题
进入组件页面时,vue报错:Error in mounted hook: "TypeError: handler.call is not a function", 造成报错原因就是 ...
- 【leetcode】1261. Find Elements in a Contaminated Binary Tree
题目如下: Given a binary tree with the following rules: root.val == 0 If treeNode.val == x and treeNode. ...
- 获得 Client 的相关信息
1.获得 Client 的相关信息 package com.shine.sun.small; import java.net.InetAddress; @Slf4j public class netI ...
- UVa 1595 Symmetry (set && math)
题意:给出n个在直角坐标系上的点,问你能不能找出一条竖轴(即垂直于x的轴)使得所有的点根据这条轴对称,能则输出YES,否则输出NO 分析:首先需要找到对称轴的值,将所有n个点的x轴的值加起来然后去除以 ...
- AbpUser 扩展
AbpUser表存放的信息比较少,现扩展一下信息 1.在Core层添加UserExtend 类,继承 AbpUser<User>,写入以上各项属性字段,并添加Discriminator 字 ...