前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >播放声音文件脚本

播放声音文件脚本

原创
作者头像
用户1168904
修改2021-05-17 15:25:40
1.2K0
修改2021-05-17 15:25:40
举报
文章被收录于专栏:运维相关文档

首先编写远程免密脚本/home/temp/autossh.sh

#!/usr/bin/expect

set password "123456"

spawn ssh [lindex $argv 0] [lindex $argv 1]

#The Sshtime is 10secs

set timeout 10s

expect "*@*pass*"

set timeout 10

send "$password\r"

#set timeout 30

#send "exit\r"

expect eof

引用autossh.sh编写远程执行播放脚本autoaplay.sh

#!/bin/sh

/home/temp/autossh.sh root@192.168.1.1 "aplay /home/temp/$1"

执行脚本方式:

autoaplay.sh test.wav

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档