|
发表于 2005-4-4 15:27:36
|
显示全部楼层
Post by lksj
- [root@localhost log]# a=abc
- [root@localhost log]# b=def
- [root@localhost log]# c="$a//n$b"
- [root@localhost log]# echo $c
- abc//ndef
- [root@localhost log]# c="$a/n$b"
- [root@localhost log]# echo $c
- abc/ndef
- [root@localhost log]# c="$a\n$b"
- [root@localhost log]# echo $c
- abc\ndef
- [root@localhost log]# c="$a\\n$b"
- [root@localhost log]# echo $c
- abc\ndef
- [root@localhost log]# c="$a/\n$b"
- [root@localhost log]# echo $c
- abc/\ndef
- [root@localhost log]# c="$a\/n$b"
- [root@localhost log]# echo $c
- abc\/ndef
- [root@localhost log]#
复制代码
呵呵,兄弟可是用穷举法啊 ;)
我来一个
- $ a=hello
- $ b=world
- $ echo $a
- hello
- $ echo $b
- world
- $ c="$a\n$b"
- $ echo $c
- hello\nworld
- $ echo -e $c
- hello
- world
复制代码 |
|