当前位置:网站首页>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语言力扣第61题之旋转链表。双端队列与构造循环链表
- 请问,在sql client中,执行insert into select from job时,如何单
- 从淘宝,天猫,1688,微店,京东,苏宁,淘特等其他平台一键复制商品到拼多多平台(批量上传宝贝详情接口教程)
- 不会就坚持60天吧 神奇的字典
- C语言:typedef知识点总结
- Multi rotor six axis hardware selection
- Pytoch distributed training
- Applet: Area scrolling, pull-down refresh, pull-up load more
- Down sampling and up sampling
- GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
猜你喜欢

12.优先级队列和惰性队列

Two forms of softmax cross entropy + numpy implementation

Not for 60 days, magical dictionary

Not for 58 days. Implement prefix tree

小程序:区域滚动、下拉刷新、上拉加载更多

不会就坚持61天吧 最短的单词编码

Jenkins 参数化构建中 各参数介绍与示例

C language force buckle question 61 of the rotating list. Double ended queue and construction of circular linked list

Beginner: array & String

不会就坚持67天吧 平方根
随机推荐
How to set the SQL execution timeout for flick SQL
顺序表和链表
14.haproxy+keepalived负载均衡和高可用
Multi rotor six axis hardware selection
C language force buckle question 61 of the rotating list. Double ended queue and construction of circular linked list
Taobao product details interface (product details page data interface)
Don't insist on 66 days. Weight generates random numbers
11.备份交换机
SQL time fuzzy query datediff() function
Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes
C语言:浅谈各种复杂的声明
Compilation and linking
MPU6050
不会就坚持69天吧 合并区间
Not for 60 days, magical dictionary
信号处理中的反傅里叶变换(IFFT)原理
不会就坚持68天吧 狒狒吃香蕉
How to solve the problem of store ranking?
15.federation
[material delivery UAV] record (ROS + Px4 + yolov5 + esp8266 + steering gear)