Timeline for Capture in shell variables the arguments after a command (between brackets)
Current License: CC BY-SA 3.0
        14 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 3, 2015 at 9:20 | comment | added | Clément | To grasp all possibles arguments would lead to a complicated situation (see 3.6.1 of the Biblatex doc. to have an overview of the types of arguments accepted). We suppose the arguments are plain paths, without anything fancy (space, newlines, etc.), just [a-Z], [0-9], .and/. So the actual solution works like a charm.  However, I should probably re-consider usingkpathseaandweb2c, but this is another subject ;). | |
| Feb 3, 2015 at 9:09 | comment | added | Clément | I want to grasp both \bibliographyand\addbibresourcecommands. | |
| Feb 3, 2015 at 5:26 | comment | added | John1024 | @Clément My \bibliographycommands include just simple file names (no paths) andkpathseahandles the rest.  If it is possible that your file names or paths could contain spaces, newlines, or braces, then I need more details, such as how do those characters appear in the file?  Are they escaped? .... | |
| Feb 3, 2015 at 0:25 | comment | added | Clément | @John1024 : you guessed correctly ;-). In fact, this regexp is here to find the bibliograpies (thebibfiles) used in a document, so the arguments are virtually any path + filename. | |
| Jan 31, 2015 at 18:31 | comment | added | John1024 | @mikeserv If we imagine that these were shell commands and that the arguments were Unix file names, that would be a serious issue and some method for including/escaping those characters (and more) would be needed. But, as can be inferred from the OP's command format, this question is about LaTeX. In my experience, LaTeX arguments do not have special characters. However, Clément, if your files do have commands whose arguments contain within them spaces, newlines, or closing braces, let me know about them and I'll update the answer. | |
| Jan 31, 2015 at 9:08 | comment | added | mikeserv | And what is this supposed to do: s/[ \n}]//g? What if the arguments contain spaces, newlines or otherwise? What if they contain quotes? | |
| Jan 31, 2015 at 0:35 | vote | accept | Clément | ||
| Jan 31, 2015 at 0:15 | history | edited | John1024 | CC BY-SA 3.0 | 
                
                    added 17 characters in body 
                
             | 
| Jan 30, 2015 at 23:57 | comment | added | Clément | That works like a charm, and the generous (and detailled) explanations you made surely will help me to get a better insight on sed. Thanks again. | |
| Jan 30, 2015 at 23:55 | history | edited | John1024 | CC BY-SA 3.0 | 
                
                    added 369 characters in body 
                
             | 
| Jan 30, 2015 at 23:47 | comment | added | John1024 | @Clément I updated the answer with a new algorithm that uses commas, not newlines, to divide the arguments. | |
| Jan 30, 2015 at 23:46 | history | edited | John1024 | CC BY-SA 3.0 | 
                
                    added 369 characters in body 
                
             | 
| Jan 30, 2015 at 23:42 | comment | added | Clément | Wow, that is impressive. However, this solution does not seems to work if two arguments are on the same line. | |
| Jan 30, 2015 at 23:38 | history | answered | John1024 | CC BY-SA 3.0 |