当前位置:网站首页>Shell string segmentation
Shell string segmentation
2022-07-29 04:19:00 【ytusdc】
shell String replacement problem
#!/bin/bash
string="hello,shell,split,test"
# Yes IFS Variable Replace it
OLD_IFS="$IFS" # Save the current shell The default separator , I'll recover later
IFS="," # take shell The division symbol of is changed to ,“”
array=($string) # The divider is “,”,"hello,shell,split,test" Assign a value to array It becomes an array assignment
IFS="$OLD_IFS" # recovery shell Default delimiter configuration
for var in ${array[@]}
do
echo $var
done
边栏推荐
- C语言:typedef知识点总结
- 索引的最左前缀原理
- Fuzzy query of SQL
- 不会就坚持63天吧 最大的异或
- Not for 60 days, magical dictionary
- pat A1041 Be Unique
- Why do I delete the original record (OP d) and then add a new one in Kafka when I update MySQL data
- Beginner: array & String
- 不会就坚持67天吧 平方根
- "Weilai Cup" 2022 Niuke summer multi school training camp 1 J serval and essay (heuristic merger)
猜你喜欢

Record of problems encountered in ROS learning

rman不标记过期备份

不会就坚持68天吧 狒狒吃香蕉

Back propagation process of manual BP neural network

Don't stick to it for 68 days. Baboons eat bananas

Machine vision Series 2: vs DLL debugging

不会就坚持60天吧 神奇的字典

Two forms of softmax cross entropy + numpy implementation

Deep learning training strategy -- warming up the learning rate

Copy products with one click from Taobao, tmall, 1688, wechat, jd.com, Suning, taote and other platforms to pinduoduo platform (batch upload baby details Interface tutorial)
随机推荐
数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
visio画网格
Opengauss pre check installation
Locker 2022.1.1
The structure pointer must be initialized, and the pointer must also be initialized
How to execute insert into select from job in SQL client
Labelme cannot open the picture
[common commands]
View partition table format
LCA board
No, just stick to it for 64 days. Find the insertion location
9.延迟队列
索引的最左前缀原理
Beginner: array & String
Class starts! See how smardaten decomposes complex business scenarios
Introduction and examples of parameters in Jenkins parametric construction
Not for 63 days. The biggest XOR
Jenkins 参数化构建中 各参数介绍与示例
不会就坚持58天吧 实现前缀树
It won't last for 70 days. The k-largest number in the array