---
title: "shell 编程"
author: "sharp-fcc"
date: "2014-07-05T18:40:27Z"
tags: []
categories: ["移动开发"]
slug: "shell"
draft: false
lastmod: "2014-07-19T14:31:28Z"
id: 2088629
url: "https://sharp-fcc.iteye.com/blog/2088629"
---

arr=(${line//,/ })

以 , 分割   相当于 split 函数,这是在没有空格的情况下.

 

echo "$user"|cut -d ":" -f$i  

这个更有通用性，一定要加 ""， 在while read line 的时候 不加"" 会有问题。