Re: [LIH] A couple of questions.
Hi On Tue, 13 Jun 2000, Binand Raj S. wrote: Shridhar Daithankar forced the electrons to say: Script started on Tue Jun 13 19:46:42 2000 binand@jediland[~] mkdir test binand@jediland[~] cd test binand@jediland[~/test] ls -R * ls: *: No such file or directory binand@jediland[~/test] allow_null_glob_expansion=true binand@jediland[~/test] ls -R * Everything same here, it did not work. I did not exported the variable. Are you using bash2 instead of bash? In bash2, it is Nops, I am on bash only... Bye Shridhar --- LIH is all for free speech. But it was created for a purpose - to help people discuss issues about installing and running Linux. If your messages are counterproductive to this purpose, your privileges to submit messages can and will be revoked.
Re: [LIH] A couple of questions.
Hi On Mon, 12 Jun 2000, Binand Raj S. wrote: That is because the shell wildcard expands *.cbl, and since there are no such files in the current directory, the expansion fails. So, shell passes the string *.cbl to ls, which tries to open a directory called *.cbl, which does not exist. The fix in bash is to set allow_null_glob_expansion to true in your .profile or whatever. Fine enough, it did produce the output but it was same as 'ls -R' [shridhar@neptune shridhar]$ allow_null_glob_expansion=true [shridhar@neptune shridhar]$ export allow_null_glob_expansion [shridhar@neptune shridhar]$ ls -R *.cbl|more The output produced was same as 'ls -R'. Did I do anything wrong? Bye Shridhar --- For more information on the LIH mailing list see: http://lists.linux-india.org/lists/LIH
Re: [LIH] A couple of questions.
Shridhar Daithankar forced the electrons to say: Fine enough, it did produce the output but it was same as 'ls -R' [shridhar@neptune shridhar]$ allow_null_glob_expansion=true [shridhar@neptune shridhar]$ export allow_null_glob_expansion [shridhar@neptune shridhar]$ ls -R *.cbl|more The output produced was same as 'ls -R'. Did I do anything wrong? Well, this worked for me. Check this typescript file: Script started on Tue Jun 13 19:46:42 2000 binand@jediland[~] mkdir test binand@jediland[~] cd test binand@jediland[~/test] ls -R * ls: *: No such file or directory binand@jediland[~/test] allow_null_glob_expansion=true binand@jediland[~/test] ls -R * .: binand@jediland[~/test] exit Script done on Tue Jun 13 19:47:05 2000 Are you using bash2 instead of bash? In bash2, it is shopt -s nullglob Or maybe you shouldn't export the variable. Binand -- The prompt for all occasions: export PS1="F:\$(pwd | tr '/[a-z]' '\134\134[A-Z]') " --- Binand Raj S. ([EMAIL PROTECTED]) --- For information on this and other Linux India mailing lists check out http://lists.linux-india.org/
Re: [LIH] A couple of questions.
Shridhar Daithankar forced the electrons to say: [shridhar@neptune shridhar]$ cd Gold [shridhar@neptune Gold]$ ls -al total 23 drwxrwxr-x4 shridhar shridhar 1024 Jun 12 12:04 . drwx--5 shridhar shridhar 1024 Jun 8 10:44 .. drwxr-xr-x2 shridhar shridhar19456 Jun 12 12:03 cbls drwxr-xr-x 24 shridhar shridhar 1024 Jun 12 12:24 others [shridhar@neptune Gold]$ ls -R *.cbl ls: *.cbl: No such file or directory That is because the shell wildcard expands *.cbl, and since there are no such files in the current directory, the expansion fails. So, shell passes the string *.cbl to ls, which tries to open a directory called *.cbl, which does not exist. The fix in bash is to set allow_null_glob_expansion to true in your .profile or whatever. Binand -- The prompt for all occasions: export PS1="F:\$(pwd | tr '/[a-z]' '\134\134[A-Z]') " --- Binand Raj S. ([EMAIL PROTECTED]) --- The LIH mailing list archives are available at: http://lists.linux-india.org/cgi-bin/wilma/linux-india-help
Re: [LIH] A couple of questions.
hi list one more thing , ls * in the current directory is listing the contents of my directory recursively on my machine. how is that ?( using bash ) something like echo */* . for i would expect ls * to list only the files in current directories + the directory names .. Shridhar Daithankar wrote: Hi all I am stuck with couple of silly questions. Please help.. 1)'ls -R' does not list recursively. Consider this.. [shridhar@neptune shridhar]$ cd Gold [shridhar@neptune Gold]$ ls -al total 23 drwxrwxr-x4 shridhar shridhar 1024 Jun 12 12:04 . drwx--5 shridhar shridhar 1024 Jun 8 10:44 .. drwxr-xr-x2 shridhar shridhar19456 Jun 12 12:03 cbls drwxr-xr-x 24 shridhar shridhar 1024 Jun 12 12:24 others [shridhar@neptune Gold]$ ls -R *.cbl l -- ~!@#$%^*()_+ of late i have discovered this talent that I am happy the way I am Rajeev Jha Email: [EMAIL PROTECTED] Tring Tring : +91(20)5424301 Xtn: 1126 web: http://www.rajeevjha.com --- --- The LIH mailing list archives are available at: http://lists.linux-india.org/cgi-bin/wilma/linux-india-help
Re: [LIH] A couple of questions.
On Mon, 12 Jun 2000, Shridhar Daithankar wrote: 1)'ls -R' does not list recursively. [shridhar@neptune Gold]$ ls -R *.cbl ls: *.cbl: No such file or directory No, ls -R does list recursively but the parameters must make sense. Here *.cbl implies that you are looking for some files ending with .cbl in the current directory. If you want to do what I think you wish to , use find command like "find . -name *.cbl -ls " or you can use grep to "grep" the pattern. Enjoy life. Ajay kumar Dwivedi --- The LIH mailing list archives are available at: http://lists.linux-india.org/cgi-bin/wilma/linux-india-help