I am having an issue with using cygwin (on Windows XP). My script errors on if -command. The script here works fine on Linux, but cygwin fails...
The error -message:
./ShellTest.sh: line 4: syntax error near unexpected token `fi'
./ShellTest.sh: line 4: `fi'
Hi, all,
I try to run a quite simple bash script mytest.sh in cygwin, it's content is:
#!/bin/bash
echo "It is my first bash shell"
there are three lines in the script. The second line is blank line.
When I run it use command: bash c:/mytest.sh, ... (6 Replies)
I ran into this issue and thanks to various postings in various forums, was
able to figure out the solution but didn't see one posting that laid the
whole issue out cleanly. So thought the following might help others ...
------------------------------------------------------------------------... (2 Replies)
I'm using cygwin scp to copy a file down from a AIX server to my laptop.
I've got he script working from the command line. The file I'm copying is Processed.Apr21 and I'm copying it to /event_transfer folder on my laptop.
scp username@149.131.224.104:/var/Tivoli/logs/Events/processed.Apr21... (3 Replies)
Hello!
I have somo problems with simple scripts like this:
#!/bin/bash
echo -n "Enter your name and press : "
read var_name
echo "Your name is: $var_name"
When I try to run it, this error occurs: ':not a valid identifier var_name.
Why?? (I work in cygiwin)
Is there anybody out... (10 Replies)
Hi,
I have a cywin test script as below but errors,
#!/usr/bin/bash
while
do
echo "123"
echo "456"
done
sh-3.2$ ./test.sh
./test.sh: line 7: syntax error: unexpected end of file
Please help...
Thanks!
Victor (3 Replies)
hi,
I am using Cygwin for running the shell script.
If i execute the following command at the prompt output is obtained.
grep echo *
The same i have put in a file and when am trying to execute it is throwing error.
IP.sh
echo "Starting command..........."
grep echo *
... (9 Replies)
I'm using cygwin on win7, What I would like to do is something like this:
cygstart cygwin tail -f /foo/test.log | perl -pe 's/error/\e
I know I can start a new instance using either of these:
mintty -e ...
cygstart tail ...
But neither of those open in ANSI mode, so I can't do... (0 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
I have a file with below format :
2013-05-20 hello
has done
2013-05-20 hi
000abc
abc
2013-05-21 thank you
I want the out put to be like this :
2013-05-20 hello has done
2013-05-20 hi 000abc abc
2013-05-21 thank you
What I could think of is something like this :
cat... (7 Replies)
Discussion started by: Sparta
7 Replies
LEARN ABOUT DEBIAN
test::needsdisplay
Test::NeedsDisplay(3pm) User Contributed Perl Documentation Test::NeedsDisplay(3pm)NAME
Test::NeedsDisplay - Ensure that tests needing a display have one
SYNOPSIS
In your Makefile.PL...
use inc::Module::Install;
# ... or whatever else you use
# Check for a display
use Test::NeedsDisplay;
# ... your Makefile.PL content as normal
And again in each test script that loads Wx
#!/usr/bin/perl
use strict;
use Test::NeedsDisplay;
# Test content as normal...
DESCRIPTION
When testing GUI applications, sometimes applications or modules absolutely insist on a display, even just to load a module without
actually showing any objects.
Regardless, this makes GUI applications pretty much impossible to build and test on headless or automated systems. And it fails to the
point of not even running the Makefile.PL script because a dependency needs a display so it can be loaded to find a version.
In these situations, what is needed is a fake display.
The "Test::NeedsDisplay" module will search around and try to find a way to load some sort of display that can be used for the testing.
Strategies for Finding a Display
At this time, only a single method is used (and a very simple one).
Debian Linux has a script called "xvfb-run" which is a wrapper for the "xvfb", a virtual X server which uses the linux frame buffer.
When loaded without a viable display, the module will re-exec the same script using something like (for example) "xvfb-run test.t".
As such, it should be loaded as early as possible, before anything has a chance to change script parameters. These params will be resent
through to the script again.
METHODS
There are no methods. You simply use the module as early as possible, probably right after "use strict;" and make sure to load it with only
default params.
Specifically, need must always load it before you set the test plan, otherwise the test script will report two plans, and the harness will
complain about it and die.
# Use it like this ...
use Test::NeedsDisplay;
# ... not like this ...
use Test::NeedsDisplay 'anything';
# ... and not like this.
use Test::NeedsDisplay ();
And that's all there is to do. The module will take care of the rest.
TO DO
- Find alternative ways to launch a display on different platforms
SUPPORT
Bugs should be reported via the CPAN bug tracker at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-NeedsDisplay>
For other issues, contact the author.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2005 - 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.10.0 2009-01-04 Test::NeedsDisplay(3pm)