I want to save the output from a bash script which is invoked from a C program to a variable declared in the C program. I searched and tried successfully calling a script using system, and I tried this, but it didn't work:  char* a; system("a=`ls`"); printf("%s",a);
I've got a utility that outputs a list of files required by a game.  How can I run that utility within a C program and grab its output so I can act on it within the same program? UPDATE: Good call on the lack of information.  The utility spits out a series of strings, and this is supposed to be portable across Mac/Windows/Linux.  Please note, I'm looking for a programmatic way to execute the utility and retain its output (which goes to stdout).
How can I access google.com outside the US? I live in the UK, and whenever I visit google.com I am redirected to google.co.uk, but I want to see my website's rankings on the US version (I presume the results are different). Is there a way to do this? Using apt-get to remove packages and dependencies Are delphi variables initialized with a value by default? Determine $4$ specific digits in $34!$ Find the values of $a,b,c,d\in\mathbb{N}$ such that      $$ 34!=295232799cd9604140847618609643ab0000000 $$   My Attempt:  The factorial of $34$ contains a $3$, so the RHS must be divisible by  $3$. Similarly, it must be divisible by $7$, $11$, $13$, $19$ etc.  But I do not understand how can I calculate $a,b,c,d$ in this equation. The Bash Manual says   { list; }        Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is   created. The semicolon (or newline) following list is required.      The braces are reserved words, so they must be separated from the list   by blanks or other shell metacharacters.       The parentheses are operators, and are recognized as separate tokens   by the shell even if they are not separated from the list by   whitespace.   If I remove the semicolon, like this:  $ { date } &gt;    Why does it expect stdin input? A metacharacter is a character that separates words.  The semicolon and whitespace are both "shell metacharacters". Why can't whitespace separate words date and }? Why do we need a semicolon instead of a whitespace for separating the words? Adobe Illustrator: strange behavior while aligning objects Solve a linear system with more variables than equations I am getting the following error in a Drupal 8 site.     The following module is missing from the file system   It looks as if a custom module was installed and deleted without uninstalling it.   How can I fix this error? I am looking for a driver for the TP-Link AC600 Archer T2U Nano, on Kubuntu 18.04 (kernel version 4.15.0-51-generic).   I already tried different drivers, none of them worked. Upgrading my Wubi 11.04 to 11.10 I want to upgrade my current Wubi installation (Ubuntu 11.04) to Ubuntu 11.10. Is this possible to do inside Wubi? Or do I have delete Wubi from Windows, therefore deleting my current Ubuntu installation; and then install 11.10 via the Wubi installer?  Thanks Viewshed analysis plugin on QGIS keeps resulting in errors I've been trying to test the Viewshed analysis plugin on QGIS 2.10, but it keeps giving back error messages. I've tried to reduce the radius area and have also reprojected both my DEM and my point shapefile to UTM, in order to avoid a possible memory error mentioned in another question regarding this plugin (that the using of geographic coordinates might cause a memory error).  Still, I keep getting Python error messages when I try to run it. Does anyone know whats going on? Is this plugin "broken"? Where should I start with Star Trek? (TV series only, not the movies) I haven't seen any of the stuff in the Star Trek franchise, except for one of the movies, and now I want to remedy the situation. I am not interested in the movies, just the TV series. However, since the show has many seasons, I am not interested in watching the show start to finish. So, where (i.e what series/season) should I start with? Do I really need to see the series in real-world chronological order?   Note: I am somewhat familiar with Star Trek, that is I know the basic premise - ships in space, with war between different space-faring sentient species. How to check if a number is a power of 2 Today I needed a simple algorithm for checking if a number is a power of 2.  The algorithm needs to be:   Simple Correct for any ulong value.   I came up with this simple algorithm:  private bool IsPowerOfTwo(ulong number) {     if (number == 0)         return false;      for (ulong power = 1; power &gt; 0; power = power &lt;&lt; 1)     {         // This for loop used shifting for powers of 2, meaning         // that the value will become 0 after the last shift         // (from binary 1000...0000 to 0000...0000) then, the 'for'         // loop will break out.          if (power == number)             return true;         if (power &gt; number)             return false;     }     return false; }   But then I thought, how about checking if log2 x is an exactly round number? But when I checked for 2^63+1, Math.Log returned exactly 63 because of rounding. So I checked if 2 to the power 63 is equal to the original number - and it is, because the calculation is done in doubles and not in exact numbers:  private bool IsPowerOfTwo_2(ulong number) {     double log = Math.Log(number, 2);     double pow = Math.Pow(2, Math.Round(log));     return pow == number; }   This returned true for the given wrong value: 9223372036854775809.  Is there a better algorithm? How do I suppress error messages from cp? Get the cartesian product of a series of lists? How can I forward delete on iOS? Is there a way to delete text in front of the caret using the iOS software keyboard? The small wireless hardware keyboard accomplishes this with a fn+delete, so there might be a way to use multiple keys to accomplish the same task in iOS? Create a local texmf tree in MiKTeX Why is it that Blender will only allow me to render with a CPU (GPU choice is unavailable)? Or is it until I acquire a graphics card that is specially built for such a task?  The images below show a Dell System Diagnostics (Video calibration) and GPU-Z results.      Platform: Dell Inspiron 3521 notebook with Core&nbsp;i3 Intel HD Graphics 4000 What to do about a 2-year-old who won't sleep without someone else in the room? My 2-year-old son won't fall asleep without having someone in his room with him. He doesn't want to be touched or held. He just wants you to sit in the chair. And after he does go to sleep he wakes up about 4 to 5 hours later, crying and screaming and is out of his bed and by the door. I go to him and give him a hug and put him right back in his bed. If I walk out he screams and won't go back to sleep for the rest of the night. If I stay he goes right back to sleep. But he wakes right back up when I walk out of his room.   I'm at a loss as to what to do. I've tried lots of stuff and nothing seems to work. It's almost as if he is having separation anxiety. I dont know what to do. Please help. Does this sentence have too many subjunctives?