---
title: "shell字符串操作（替换,截取）"
author: "ama2000"
date: "2013-02-05T15:11:51Z"
tags: []
categories: ["编程语言"]
slug: "shell"
draft: false
lastmod: "2013-02-05T15:11:51Z"
id: 1791217
url: "https://ama2000.iteye.com/blog/1791217"
---

A='abc.sina.txt';

 

echo ${A:**(-****3****)**} #从倒数第三个开始截取，即：取最后3个