1
vote
3answers
247 views

How to identify the local network you are connected to

I need a script to be able to identify if the computer is connected to my home network, to my work network, o to a different network, either by wifi or by cable. My question is if there some network ...
0
votes
2answers
997 views

Shell Script Error using Cygwin

I got this error after execute shell script as below. $ ./script_test.sh ./script_test.sh: line 3: syntax error near unexpected token `$'do\r'' '/script_test.sh: line 3: `for ((j=0; j<"$N"; j++)) ...
-2
votes
2answers
410 views

How to run apache server if it not already running

I wonder if it is possible to check whether or not apache2 is running. If it is not running I want to execute it using shellscript Currently I have added a function which I named run_apache which ...
2
votes
4answers
5k views

Run shell script on windows using Cygwin

I am having trouble with running .sh script on Windows using Cygwin. When i run the file: ./build.sh -s srv.txt I am getting: ./build.sh: line 1: #!/bin/bash: No such file or directory Can you guys ...
0
votes
1answer
628 views

Rsync in bash script not recognizing spaces

An excerpt from a bash script I'm using to backup some photos: #!/bin/bash FROM="/cygdrive/f/\"Trip to Austria\"" TO="/cygdrive/s/\"Trip to Austria\"" rsync -av $FROM $TO When I print the final ...
0
votes
1answer
504 views

What is the difference between executing script using Cygwin and PuTTY?

Now I get a script.sh, previously it was executed using PuTTY provided it was written in VMWare, but now I want to execute in Windows using Cygwin, I already copy the script.sh out to the ...
1
vote
2answers
14k views

How to execute shell script in cygwin?

I store name.sh under C:\Documents and Settings\user when i type sh name.sh in Cygwin, sh: testing.sh: No such file or directory any help will be appreciated!
2
votes
3answers
3k views

How to use cygwin (or linux command) to rename the files and directories recursively with regular expression

I am using Windows, and trying to use Cygwin to perform this task. I would like to rename the files and directories recursively as following: From: 1010110010\ 1010110010\1010110010.jpg ...
2
votes
1answer
161 views

Why doesn't “find -print0” work in Cygwin under Vista?

I'm writing a simple shell script: find datafiles/ -type f -print0 | xargs -0 md5sum > datafiles.md5 In Cygwin under Vista, it just sits there and nothing happens. It works fine on Linux. What ...