Guest Vaibhav Posted February 19, 2007 Report Share Posted February 19, 2007 (edited) hi I was learning about samba and I learnt that coders of SAMBA decided on its name by searching directory by using the command :- grep -i "s.*m.*b.*" /home/dictionary/words why they have used . (dot) here when there is no special character in books as . (dot) . As by rules "s*m*b*" should work . I also tried the command in a directory, where I added a new file sambar.dia. using ls | grep -i "s*m*b*" gave names of all the files or directories with s, m or b. But by using ls | grep -i "s.*m.*b.*" I got the correct output (only a single file) sambar .dia Please tell me the explanation of this observance. One more query please In my mandrake 9.1 installation browsers(mozilla and Konqueror) are not able to access ftp sites. What may be the problem? Are settings to be changed to enable accessing FTP sites. Thanks Edited February 19, 2007 by Vaibhav Quote Link to comment Share on other sites More sharing options...
neddie Posted February 19, 2007 Report Share Posted February 19, 2007 Grep uses regular expressions which are a very powerful way of specifying your search. Check out Wikipedia for more info. Basically, a dot . represents "any character" and an asterisk * represents "the previously mentioned character 0 or more times". So the regular expression s.*m matches an s, followed by any number of any character, followed by an m. If for example you had sa*m then it would match sm, sam, saaaaaaaaaaam and so on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.