j***y 发帖数: 2074 | 1 what's the meaning the following expression?
vi load_image.sh
pls be as detailed as possible, thanks, | T********r 发帖数: 6210 | 2
1,$: from the first line of the file to the last line
s: find some matching pattern, and replace with another pattern
/: begin the matching pattern
.: match any character
*: match any number of characters, i.e., 0 - any characters
/: end of the matching pattern, begin the replacing pattern
.\/load_image.pl Image\/: replacing pattern is ./load_image.pl Image/
note the difference between a single '/' and '\/'. for '/', it is
the delimit character between patterns. for '\/', it represents th
【在 j***y 的大作中提到】 : what's the meaning the following expression? : vi load_image.sh : pls be as detailed as possible, thanks,
| j***y 发帖数: 2074 | 3
I find this is the most difficult part. All others I can understand.
So with "&" present, the effect is to insert the string "./load_image.pl
Image/" in the beginning of every line in the file, coz "&" tells it not to
match anything, right?
【在 T********r 的大作中提到】 : : 1,$: from the first line of the file to the last line : s: find some matching pattern, and replace with another pattern : /: begin the matching pattern : .: match any character : *: match any number of characters, i.e., 0 - any characters : /: end of the matching pattern, begin the replacing pattern : .\/load_image.pl Image\/: replacing pattern is ./load_image.pl Image/ : note the difference between a single '/' and '\/'. for '/', it is : the delimit character between patterns. for '\/', it represents th
| T********r 发帖数: 6210 | 4
frankly speaking, I do not know the meaning of & either. just made a guess
here, hehe. ok, my guess might be wrong. & probably means the matched
pattern. check the following link:
http://www.unicode.org/reports/tr18/
【在 j***y 的大作中提到】 : : I find this is the most difficult part. All others I can understand. : So with "&" present, the effect is to insert the string "./load_image.pl : Image/" in the beginning of every line in the file, coz "&" tells it not to : match anything, right?
| j***y 发帖数: 2074 | 5
Yes, you are right on this point.
http://www.cis.tugraz.at/zid/peter/unix/regular.html
【在 T********r 的大作中提到】 : : frankly speaking, I do not know the meaning of & either. just made a guess : here, hehe. ok, my guess might be wrong. & probably means the matched : pattern. check the following link: : http://www.unicode.org/reports/tr18/
|
|