RE: cygwin bash include scripting and error code return question

2012-03-25 Thread John Fairhall
The pipe is definitely the problem.

If I have this:

bash mainScript.sh 2>&1
bash mailBuild.sh %ERRORLEVEL% %LOGFILE%

When I gimmick mainScript to exit with any non-zero value I get an ERRORLEVEL 
of 255.

However, when I do this:

bash -o pipefail mainScript.sh 2>&1 | tee $LOGFILE bash mailBuild.sh 
%ERRORLEVEL% %LOGFILE%

I always get a zero ERRORLEVEL.

When I try this:

bash -o pipefail -c "mainScript.sh  2>&1 | tee %LOGFILE%"
it errors with
bash: mainScript.sh: command not found

J.




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



bug developed in bash in recent release...ignores control-c if typed during input.

2012-03-25 Thread Linda Walsh


Normally if I type control-c, it aborts the line I am on, and gives me a new 
prompt.

After an upgrade a few weeks ago (and retried today with a fresh re-inst of 
bash), the control-c has been getting ignored!


... have to remember line clear... the control-c doesn't echo -- just ignored.

If I look at stty, the setting there says
> stty
speed 38400 baud; line = 0;
kill = ^X; susp = ^Y;
-imaxbel
-echoe -echok -echoctl -echoke
/Users/law> stty -a
speed 38400 baud; rows 60; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^X; eof = ^D; eol = ;
eol2 = ; swtch = ^Z; start = ^Q; stop = ^S; susp = ^Y; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo -echoe -echok -echonl -noflsh -tostop -echoctl -echoke
---
with relevant parts being the -ignbrk (don't ignore break), intr=^C -- control-c 
still set as interrupt char, though maybe it wasn't on before, but I tried it..

'echoctl'...
(it's on on my linux box)... made no difference...

still ignores controls-c

BUT  -- if I do a stty ignbrk -- then, it works the way it used to.

So is the fact that the settings of 'ignore break' on stty a new feature,
fodder for the 'incident queue', or what?





> bash --version
bash --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
> uname -a
uname -a
CYGWIN_NT-6.1-WOW64 Athenae 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: cygwin bash include scripting and error code return question

2012-03-25 Thread Linda Walsh

John Fairhall wrote:


Hi,

I have a cygwin bash script running on 32 bit XP.

I have a windows BAT script calling bash, like so:

---
bash mainScript.sh 2>&1 | tee %LOGFILE%
bash mailBuild.sh %ERRORLEVEL% %LOGFILE%
---


What I was hoping was that bash would propagate the shell script's return code 
to the external OS, but as far as I can see the windows ERRORLEVEL is always 0.

Is there a way to make bash do this?



	Question -- is %ERRORLEVEL% returning the value of bash or the value of 'tee'? 
  I am guessing it returns the value of 'tee'.


If you want to do what you are doing...um...

  bash -o pipefail -c "mainScript.sh  >| tee %LOGFILE%"



should do it...

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: du crashes if .lnk symlink and a folder it points to are named the same, differing only in letter case

2012-03-25 Thread Linda Walsh

Ilya Basin wrote:


I needed that because one git repository has branches named
"Epam/a" and "epam/b", and git was always creating the "missing" epam
directory at fetch.

$ ls -l
total 0
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 Epam
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 epam

why no " -> Epam" part? 'ls' behaves funny too, but at least it
doesn't crash.


$ ls -l epam.lnk
lrwxrwxrwx 1 Users None 4 Mar 13 16:43 epam.lnk -> Epam

$ du .
0   ./Epam
Aborted (core dumped)


=
You might try setting going into system properties, advanced, Environment 
Variables and creating an entry (or adding to the original if there is one there 
already) for CYGWIN.  Entries to have in it:\

winsymlinks export#(+opt) [nodosfilewarning]

I have  a feeling you are seeing probs related to the cygwin hard link emulation
which can by turned off by telling it to use winsymlinks (export tells it to 
export the value to children processes -- nodosfilewarning lowers clutter --
especially when you have domain names. (and have references to paths with 
'domain\\user/xxyz' in them).



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: mkpasswd and domain fail with windows network

2012-03-25 Thread Linda Walsh

Furash, Gary F - (furashg) wrote:


I've had this problem in the past with in other organizations and have never 
been able to get around it.

Problem: running mkpasswd w/ '-D' doesn't work/finish

Details: I am running Cygwin on Windows 7 64 bit in a typical work environment. I don't think that matters because I've had this exact problem before with other employers. The MKGROUP command with the domain parameter works fine, and populates all the real domains into /etc/groups. However, 
- if I run mkpasswd with only -L, I just get the local accounts, none of which are me (I'm part of a domain);

- if I run mkpasswd with -D, it just hangs indefinitely
- it doesn't matter if I run it as Administrator or not
- it doesn't matter if port 135 is open or not. I checked that because if I run 
the mkpasswd -D command with the laptop disconnected from the network, it 
actually fails with an RPC unable to contact domain error.
- using -D versus -d doesn't make a difference, as does adding -l (it just 
spits out the local accounts then fails or hangs.



Have you tried running it with 'strace -f -n mkpasswd ...' and see where it 
seems to be hanging up?  At least you might be able to tell if it is trying to 
read or just hung for some other reason.


FWIW, I have a tiny domain @home, and it's currently working... (its an off then 
on again thing depending on windows updates, samba updates, not to mention 
cygwin updates... and how they all play together..always a joy!)


Also, if it looks like it might be stuck in some call, you could try using 
'wireshark', to look at the network traffic to/from your machine and see if it 
is downloading a long list of what looks like users/domains (unless your network

is encrypted, then you'll see a long string of binary...)

Just some ideas...




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



cygwin bash include scripting and error code return question

2012-03-25 Thread John Fairhall
Hi,

I have a cygwin bash script running on 32 bit XP.

I have a windows BAT script calling bash, like so:

---
bash mainScript.sh 2>&1 | tee %LOGFILE%
bash mailBuild.sh %ERRORLEVEL% %LOGFILE%
---


What I was hoping was that bash would propagate the shell script's return code 
to the external OS, but as far as I can see the windows ERRORLEVEL is always 0.

Is there a way to make bash do this?

John.



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



du crashes if .lnk symlink and a folder it points to are named the same, differing only in letter case

2012-03-25 Thread Ilya Basin
I needed that because one git repository has branches named
"Epam/a" and "epam/b", and git was always creating the "missing" epam
directory at fetch.

$ ls -l
total 0
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 Epam
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 epam

why no " -> Epam" part? 'ls' behaves funny too, but at least it
doesn't crash.


$ ls -l epam.lnk
lrwxrwxrwx 1 Users None 4 Mar 13 16:43 epam.lnk -> Epam

$ du .
0   ./Epam
Aborted (core dumped)

crash caused by abort() called from here:

coreutils-8.15/lib/fts-cycle.c:
static void
leave_dir (FTS *fts, FTSENT *ent)
{
  struct stat const *st = ent->fts_statp;
  if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
  struct Active_dir obj;
  void *found;
  obj.dev = st->st_dev;
  obj.ino = st->st_ino;
  found = hash_delete (fts->fts_cycle.ht, &obj);
  if (!found)
abort (); <-- here


cygcheck.out
Description: Binary data
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple