This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin for Fedora?

On 03/08/2012 02:45 AM, Harry Simons wrote:
Basically, I want my scripts to be able to run flawlessly on both Fedora and Cygwin/Windows systems.

I have a universal .bashrc file that I use on Linux, Cygwin and the occasional FreeBSD or NetBSD systems. In it I make use of "uname -s" to handle peculiarities like this:

 case "$(uname -s)" in
     Linux)   echo "Do Linux-specific stuff here"   ;;
     CYGWIN*) echo "Do Cygwin-specific stuff here"  ;;
     *BSD)    echo "Do BSD-specific stuff here"     ;;
     *)       echo "No support for $(uname -s) yet" ;;

I also have come to prefer the Cygwin "putclip" and "getclip" to the Linux "xclip". But not all platforms have both, so this portion of my universal .bashrc protects putclip/getclip if they exist or otherwise creates them out of xclip if it exists.

 if [ -n "$(type -P xclip)" ]; then
     test -z "$(type -P putclip)" && \
         alias putclip="$(type -P xclip) -sel clip -i"
     test -z "$(type -P getclip)" && \
         alias getclip="$(type -P xclip) -sel clip -o"
     alias xclip='xclip -sel clip'

-Ken Jackson

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]