How to detect the OS from a Bash script?

I would like to keep my .bashrc and .bash_login files in version control so that I can use them between all the computers I use. The problem is I have some OS specific aliases so I was looking for...

How do I get the Git commit count?

I'd like to get the number of commits of my Git repository, a bit like SVN revision numbers. The goal is to use it as a unique, incrementing build number. I currently do like that, on...

Run bash script from Windows PowerShell

In cygwin, I could just do ./script.sh args, but this opens the script file in notepad in PowerShell. What do I need to do have it execute?

Can't seem to discard changes in Git

After seeing the following from the command line: # On branch RB_3.0.10 # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout --...

How can I create an empty file at the command line in Windows?

How can I create an empty file at the DOS/Windows command-line? I tried: copy nul > file.txt But it always displays that a file was copied. Is there another method in the standard cmd? It should...

send sms through kannel using the fake SMS center

I configured kannel as fake SMS center. But when I try to send sms, I get the following error: 2010-02-24 15:12:30 [932] [12] DEBUG: send_msg: sending msg to box: <127.0.0.1> 2010-02-24 15:12:30...

Using awk to print all columns from the nth to the last

This line worked until I had whitespace in the second field. svn status | grep '\!' | gawk '{print $2;}' > removedProjs is there a way to have awk print everything in $2 or greater? ($3, $4.....

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7...

Recipe for target `autoloads' failed while building Emacs in Cygwin

I am trying to build Emacs on 64-bit Windows 7 using Cyqwin: Emacs 23.3 or 23.4 CYGWIN_NT-6.1-WOW64 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin Some info from ./configure log: What compiler...

Why does Ctrl-Z on Windows Git bash shell fail?

I sometimes have to work in Windows, which often means using the Bash shell. If I am (for example) in vim (not gvim) with several files open, and I hit CtrlZ to briefly go back to the shell and...

fatal: early EOF fatal: index-pack failed

I have googled and found many solutions but none work for me. I am trying to clone from one machine by connecting to the remote server which is in the LAN network. Running this command from...

gcloud not recognized as an internal or external command on Windows

I am installing Google App Engine under Windows (not using Cygwin). After running the bat script, I closed and reopened the cmd.exe and entered inside the google-cloud-sdk directory. When I ran...

How to get the output of `find` as a space separated string?

I would like to list all the filenames inside a directory as a single argument string line that uses the Space character as separator. Let's consider this directory: /project ├─ foo...

Mysterious linker error "undefined reference to `__gxx_personality_v0'" using clang in cygwin

I did some search, all answers seem to suggest that using clang++ instead of clang (or rather g++ in place of gcc), which is what I did in the first place. Still, the problem persists, with...

C++ Cannot call constructor directly in small example

I was wondering, why I cannot call a constructor. Even this small example fails to compile with the message: Klassentest.cpp:24:27: error: cannot call constructor 'Sampleclass::Sampleclass'...

Windows: run python command from clickable icon

I have a python script I run using Cygwin and I'd like to create a clickable icon on the windows desktop that could run this script without opening Cygwin and entering in the commands by hand. how...

__POSIX_VISIBLE is ruining my pthreading on cygwin

I'm compiling a project that uses pthreads with gcc (g++ exactly) on cygwin. Seeing as how I have always developed this on linux, I never had any problems. But right now, I am unable to compile...

CommonAPI CMake Error

I try to build a CommonApi Some/IP project. The tutorial is from this website: CommonAPI Some/IP Tutorial I'm now trying to build the cpp-someip-runtime with the cmake gui. If I try to generate...

How to know when there is input through the terminal pipe line on C++ 11?

How to know when there is input through the terminal pipe line on C++ 11? I may call my program like this: 1. ./main solved.txt 2. cat unsolved.txt | ./main 3. cat unsolved.txt | ./main...

Not able to import numpy in cygwin

I have installed numpy using the cygwin setup, and it is showing as successfully installed. But I am not able to import it in my program. Traceback (most recent call last): File "pythonpath.py",...

how can i get out of vi editor when esc won't work?

I am using vi editor for UNIX. Sometimes I am experiencing an issue with getting out of vi editor, where I go to press esc then type ":wq" or "q!" to quit, but it is not escaping. vi editor just...

How do I install gcc on cygwin?

$ uname -r 2.9.0(0.318/5/3) I don't have the gcc or the g++ command on my path after I install cygwin. What packages do I need to install to get this command?

Error compiling CPP application. "error: 'posix_memalign' was not declared in this scope"

I'm trying to compile a CPP application (an open source project) in the latest cygwin64 environment using g++ 6.4.0 and I get the following error: error: 'posix_memalign' was not declared in this...

how to handle close connection Exception in websockets and asyncio (Python)?

I am using websockets and asyncio in Python 3.6.3 on windows cygwin. This is my code: class DataReader: def __init__(self, address): self.address = address async def...

Install jupyterlab in pip3 throws 'TypeError: expected string or bytes-like object'

Background I was trying to install Jupyter Lab using pip3 install jupyterlab, and it threw the same error. I did not figure it out. Found a workaround using pip2 install jupyterlab -- it worked,...

Compiling through macOS Terminal, fatal error: stdio.h: No such file or directory

So was trying to compile a c file (via a makefile) and got the "fatal error: stdio.h: No such file or directory" . This compiles on just fine via cygwin and a remote linux box just not my mac (so...

How to access the desktop with cygwin

I want access to my windows 10 desktop with Cygwin. I tried this $cd cygdrive/c/ $ls -al But I can't see no one folder named "Desktop".

"--watch is not supported without git/hg" with cygwin jest and git

I would really appreciate help with this. I have cygwin installed and set up to use the PATH from windows. This has been working great for a ton of node development, but I've recently run into an...

Eigen3 and Clion: How to display matrix contents in Clion ide?

I have followed the instructions for updating my GDB for use with Eigen3. However, the CLion IDE is unable to load the contents of eigen matrices in the debug panel. What should be a quick...

Is there any way to see the output of a shell script when launched through make, for SAM

I'm trying to build a multi-layer Python SAM (AWS Serverless Application Model) app. Nothing too fancy, but it has some dependencies, which are managed using pipenv. SAM has a sam build command...