geekhack
geekhack Community => Off Topic => Topic started by: iLLucionist on Mon, 24 April 2017, 09:39:46
-
Rant:
So people always say: buy Apple coz best of both worlds: MS Office + Adobe AND commandline tools.
But: OS X ALWAYS does things SO differently than your typical linux distribution.
For instance, I made a report generator that converts .svg to .pdf to include it in a latex template, that is then rendered and converted to pdf to form the final PDF.
Guess what... OS X terminal (bash? should be bash..) doesn't take "--" as a "iterate over all files for *.<extension>". No no... you have to use ugly bash for-loop.
WHY APPLE?
As a matter of fact, most of my "portable linux" code that relies on terminal commands ALWAYS needs to be slightly modified to work on OSX. OS X is even less compliant in terms of operators / prefixes for terminal commands than is *BSD.
-
https://geekhack.org/index.php?topic=50202.0
-
https://geekhack.org/index.php?topic=50202.0
Good point, will take it over there.
-
Rant:
So people always say: buy Apple coz best of both worlds: MS Office + Adobe AND commandline tools.
But: OS X ALWAYS does things SO differently than your typical linux distribution.
For instance, I made a report generator that converts .svg to .pdf to include it in a latex template, that is then rendered and converted to pdf to form the final PDF.
Guess what... OS X terminal (bash? should be bash..) doesn't take "--" as a "iterate over all files for *.<extension>". No no... you have to use ugly bash for-loop.
WHY APPLE?
As a matter of fact, most of my "portable linux" code that relies on terminal commands ALWAYS needs to be slightly modified to work on OSX. OS X is even less compliant in terms of operators / prefixes for terminal commands than is *BSD.
You could be writing bash code in Linux on a newer version of bash than OS X has.
What '--' are you talking about by the way?
-
Rant:
So people always say: buy Apple coz best of both worlds: MS Office + Adobe AND commandline tools.
But: OS X ALWAYS does things SO differently than your typical linux distribution.
For instance, I made a report generator that converts .svg to .pdf to include it in a latex template, that is then rendered and converted to pdf to form the final PDF.
Guess what... OS X terminal (bash? should be bash..) doesn't take "--" as a "iterate over all files for *.<extension>". No no... you have to use ugly bash for-loop.
WHY APPLE?
As a matter of fact, most of my "portable linux" code that relies on terminal commands ALWAYS needs to be slightly modified to work on OSX. OS X is even less compliant in terms of operators / prefixes for terminal commands than is *BSD.
You could be writing bash code in Linux on a newer version of bash than OS X has.
What '--' are you talking about by the way?
I was wrong, this is meant by the "--"-operator in a bash command:
https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash (https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash)
But still, for some reason, the default bash shell on OS X does not iteratively process files to a command when you supply it with "*.<ext>".
-
Rant:
So people always say: buy Apple coz best of both worlds: MS Office + Adobe AND commandline tools.
But: OS X ALWAYS does things SO differently than your typical linux distribution.
For instance, I made a report generator that converts .svg to .pdf to include it in a latex template, that is then rendered and converted to pdf to form the final PDF.
Guess what... OS X terminal (bash? should be bash..) doesn't take "--" as a "iterate over all files for *.<extension>". No no... you have to use ugly bash for-loop.
WHY APPLE?
As a matter of fact, most of my "portable linux" code that relies on terminal commands ALWAYS needs to be slightly modified to work on OSX. OS X is even less compliant in terms of operators / prefixes for terminal commands than is *BSD.
You could be writing bash code in Linux on a newer version of bash than OS X has.
What '--' are you talking about by the way?
I was wrong, this is meant by the "--"-operator in a bash command:
https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash (https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash)
But still, for some reason, the default bash shell on OS X does not iteratively process files to a command when you supply it with "*.<ext>".
Can you paste a full example of what you mean?
-
Rant:
So people always say: buy Apple coz best of both worlds: MS Office + Adobe AND commandline tools.
But: OS X ALWAYS does things SO differently than your typical linux distribution.
For instance, I made a report generator that converts .svg to .pdf to include it in a latex template, that is then rendered and converted to pdf to form the final PDF.
Guess what... OS X terminal (bash? should be bash..) doesn't take "--" as a "iterate over all files for *.<extension>". No no... you have to use ugly bash for-loop.
WHY APPLE?
As a matter of fact, most of my "portable linux" code that relies on terminal commands ALWAYS needs to be slightly modified to work on OSX. OS X is even less compliant in terms of operators / prefixes for terminal commands than is *BSD.
You could be writing bash code in Linux on a newer version of bash than OS X has.
What '--' are you talking about by the way?
I was wrong, this is meant by the "--"-operator in a bash command:
https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash (https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash)
But still, for some reason, the default bash shell on OS X does not iteratively process files to a command when you supply it with "*.<ext>".
Can you paste a full example of what you mean?
Burried in my Python 3.x module:
>>> os.system("mogrify -format pdf -- *.svg")
-
I installed bash and some gnu utilities with brew on the Mac to fix this. Be aware of the "--with-default-names" option when you install it.
-
I installed bash and some gnu utilities with brew on the Mac to fix this. Be aware of the "--with-default-names" option when you install it.
Thanks, that's quite helpful!