[Csnd] Stoopid shell trick - #!/usr/local/bin/csound
Date | 2009-06-19 22:51 |
From | Jacob Joaquin |
Subject | [Csnd] Stoopid shell trick - #!/usr/local/bin/csound |
This is probably obvious to some of you, but I just personally discovered a shell trick. I added "#!/usr/local/bin/csound" to the top of a csd file, a "chmod 775 test.csd", and type "./test.csd" in the terminal, and it played the file. I was kinda surprised it worked. Furthermore, when I tried "./test.csd -A -otest.aif" it overrode the CsOptions and generated a file instead. This makes me really happy. Here's my test code: ---- #!/usr/local/bin/csound |
Date | 2009-06-19 23:07 |
From | Atte Andre Jensen |
Subject | [Csnd] Re: Stoopid shell trick - #!/usr/local/bin/csound |
Jacob Joaquin wrote: > This is probably obvious to some of you, but I just personally discovered a > shell trick. I added "#!/usr/local/bin/csound" to the top of a csd file, a > "chmod 775 test.csd", and type "./test.csd" in the terminal, and it played > the file. I was kinda surprised it worked. I didn't know about that, cool. Unfortunately this depends on a unified location of the executable, mine is in /usr/bin/csound. Not like /bin/bash which always sits exactly there... -- Atte http://atte.dk http://modlys.dk http://virb.com/atte |
Date | 2009-06-20 00:46 |
From | Erik de Castro Lopo |
Subject | [Csnd] Re: Re: Stoopid shell trick - #!/usr/local/bin/csound |
Atte Andre Jensen wrote: > Jacob Joaquin wrote: > > > This is probably obvious to some of you, but I just personally discovered a > > shell trick. I added "#!/usr/local/bin/csound" to the top of a csd file, a > > "chmod 775 test.csd", and type "./test.csd" in the terminal, and it played > > the file. I was kinda surprised it worked. > > I didn't know about that, cool. Unfortunately this depends on a unified > location of the executable, mine is in /usr/bin/csound. Not like > /bin/bash which always sits exactly there... Try: #!/usr/bin/env csound The /usr/bin/env executable should *always* be in the same place and it will find the csound executable as long as it is on your $PATH. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ |