#!/bin/bash ## Our path _r1="/nfs/apache/logs/rawlogs/access.log" ## Escape path for sed using bash find and replace _r1="${_r1//\//\\/}" # replace __DOMAIN_LOG_FILE__ in our sample.awstats.conf sed -e "s/__DOMAIN_LOG_FILE__/${_r1}/" /nfs/conf/awstats/sample.awstats.conf > /nfs/apache/logs/awstats/awstats.conf
如上,代码变量_r1值中有“\”,但是在sed命令中这个值是需要处理一下的。
_r1="${_r1//\//\\/}"
可解决问题。
相关推荐
NULL 博文链接:https://lindows.iteye.com/blog/252627
原文:https://editor.csdn.net/md/?articleId=120167145
学习Bash Shell的经典教材,推荐
Bash特殊变量讲解 一些bash的特殊变量,拿来作为参考还不错
bash shell高级编程
主要是一份bash shell 4.2 的源码,共享给大家
Bash Shell 编程高级教程 (中文版)
Bash Shell 管理Linux
Cameron Newham and Bill Rosenblattham 《Learning the bash shell》是比较好的一本入门级经典教材,学linux shell 的不妨下来看看,不过是英文版的。
Bash shell编程参考手册,Linux编程必备。
《Learning the bash Shell,3rd Edition,by Cameron Newham》, bash 的权威指南,本书中文版本下载地址:http://download.csdn.net/source/2244004。内容预览: Chapter 1. bash Basics Chapter 2. Command-Line ...
bash shell
Learning the bash Shell, 3rd Edition This refreshed edition serves as the most valuable guide yet to the bash shell. It's full of practical examples of shell commands and programs guaranteed to ...
实验十二 Bash Shell相关指令练习
Learning the bash Shell Unix SHell Programming 第三版 非扫描高清版 带完整书签 学习Bash编程的最佳法宝
learn bash shell~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
里面介绍了bash shell 的操作,令你快速上手bash