News for hackers. Stuff that matters.
Re:Interesting commands for the Linux shell by godelski on Thursday September 14, 2017 @11:09AM (#15248775)
Curly brace expansion is one of the most useful and overlooked topic in these kind of posts. And I'm always surprised it isn't mentioned with compiling.

g++ -o foo{,.cpp}

Re:Interesting commands for the Linux shell by tych0 on Thursday September 14, 2017 @01:06PM (#15250035)
Worth noting that for the particular case you've cited, you can just use make, even without a makefile:

  ~ cat test.cpp 
  #include <iostream>
  
  using namespace std;
  
  int main()
  {
      cout << "hi\n";
      return 0;
  }
  ~ stat Makefile
  stat: cannot stat 'Makefile': No such file or directory
  ~ 1 make test
  g++     test.cpp   -o test
  ~ ./test
  hi
Re:Interesting commands for the Linux shell by godelski on Thursday September 14, 2017 @11:16PM (#15254315)
Well you learn something every day. That's pretty awesome! Is there an easy way to add options? Like -O2
Re:Interesting commands for the Linux shell by agumonkey on Thursday September 14, 2017 @01:57PM (#15250647)
yeah, reading make man, and also http://nullprogram.com/blog/2017/08/20/
Re:Interesting commands for the Linux shell by skykooler on Thursday September 14, 2017 @01:08PM (#15250062)
also, useful to know - zsh supports tab-completion for curly brace expansion.