Quotes changed to odd characters in gcc error msgs

2016-01-13 Thread Chuck Roberts
Hello,
I am running Cygwin 2.3.0 on Windows 7. I'm new to Cygwin and trying to
learn C programming (basic ANSI C).

I'm having 2 problems.

1) When I get an error message from the gcc compiler, the quotes in the
message are turned to high ascii characters that don't make sense. How do
I fix this? My TERM variable says "cygwin".

2) I'm using PSPad to edit some of my .C files. Since I've started using
PSPad, the directory listing of files using 'ls -l' has the occasional
file concatenated with the next file, like a carriage return is missing
somewhere. I am using colors, and load .dircolors in my .bashrc each time
I start Cygwin. Here is what I added to the bottom of my .bashrc:

function funclm
{
# Use --grou-directories-first
ls -hlF --color $@|more
}
function funcls
{
ls -hF --color $@|more
}

alias envm='env|sort|less'
alias findit='echo See locate'
alias h='history'
alias lf='funclf'
alias lm='funclm'
alias ls='funcls'
alias mv='mv -v'
alias perltext='perldoc -t -T'
alias src='source $HOME/.bashrc'

export EDITOR=nedit

# Stuff for X windows and nedit.
DISPLAY=10.19.251.67:0.0; export DISPLAY
export PAGER=/usr/bin/less

# Misc stuff
export PATH=./:$PATH
eval `dircolors -b $HOME/.dircolors`

Thank you.
Chuck

--
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: cron bug

2016-01-13 Thread Chuck Roberts
> Hello,
>
> I have set up cron as below on a fresh Windows 10 with a fresh,
> minimal 64-bit Cygwin installation. Cronjobs are not executed and
cronevents says /usr/sbin/cron:
> PID 608: (CRON) error (can't switch user context). The output of
> cronbug
is attached.

>
> When I run the service not under my own user but as an administrator,
> the result and error is the same.

First I try not to make any assumptions about what the user knows about
cron. So here are some tips.

- In general, do not edit the system crontab files, instead edit your user
crontab files with 'crontab -e' where '-e' means edit. You will need an
environment variable to setup an editor like this: 'export EDITOR=nedit'.
You can put the whole path to nedit in there if need be.

So, what is the exact command you are using to edit the crontab files?

- When the cron job runs it runs in it's own shell, with no environment
variables at all, i.e. no PATH or anything. To set environment variables
add these entries to the crontab file:

PATH=/usr/bin:/sbin:/whatever
MAIL=youruser (sends email to this account)

Each time cron runs and produces output, an email is sent to the account
in the MAIL variable.

- Next, the command must include the full path to the command like this:
1 18 29 1 * /home/comp/perl/me/gocron

If gocron is a bash script which calls a Perl program, I always pass the
working directory to my Perl program inside the 'gocron' bash script. I
think I had trouble getting the current directory inside my Perl script
with $t=`pwd`;. It would work during testing outside of cron, but when it
was run by cron, pwd didn't work. I also test my bash scripts with the
'at' command, which works very much like cron, but with less typing.

The at format is: at -f FILETORUN TIMESPEC
Example: at -f /path/to/file/gocron now (run now)
Example: at -f /path/to/file/gocron + 1 minute (run 1 minute from now)
Example: at -f /path/to/file/gocron 2:05pm (runs at 2:05pm based on the
server time)


This runs my gocron bash script after 1 minute passes. See the man page
for 'at' for more info on the TIMESPEC format.



Chuck

--
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



Is there an easy way to find the version of Cygwin I have?

2016-01-13 Thread Chuck Roberts
Including the bit depth, 32 or 64-bit. Plus critical DLL files.

Thanks!


Chuck

--
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