LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-04-2010, 11:20 AM   #16
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208

What is the current script? There was a typo in [[ PID -eq MYPID ]] && continue which should have been [[ $PID -eq $MYPID ]] && continue.
 
Old 10-05-2010, 03:30 AM   #17
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
@catkin No it's meant to be that way. They are just the same with integers.
 
Old 10-05-2010, 06:44 AM   #18
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by konsolebox View Post
@catkin No it's meant to be that way. They are just the same with integers.
Neat. How does that work? Is it that the presence of a numeric operator within the [[ ... ]] makes bash treat the logical expression as a numeric expression, in which the $ operator ($ means "value of") is implied?
 
Old 10-06-2010, 05:03 AM   #19
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by catkin View Post
Neat. How does that work? Is it that the presence of a numeric operator within the [[ ... ]] makes bash treat the logical expression as a numeric expression, in which the $ operator ($ means "value of") is implied?
Yup something like that. Maybe with -eq and the likes. That's really one of the greatest difference between test or [ and [[.
 
Old 10-06-2010, 08:37 AM   #20
binbash
LQ Newbie
 
Registered: Sep 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by konsolebox View Post
The script's only meant to run with bash. If sh.exe is your default shell, that might give a difference with operations.
well I am running it within bash
c:\cygwin\bin\bash.exe /cygdrive/c/scripts/singlei.sh $1 $2 $3 $4

but have noticed that sometimes it says

error in program=C:\cygwin\bin\sh.exe

and sometimes

error in program=C:\cygwin\bin\bash.exe

have sh.exe stackdumps in some folders and bash.exe stackdumps in other folders so I guess it is some cygwin behaviour

I still haven't really narrowed down what exactly leads to it 'locking it'

but a friend left me a note saying a number of blank (as they appear when queued anyway) bash windows had opened up and all of them were using some cpu and 7 lock files were in the folder - he said he left them open - but they were closed and only 1 lock file in the folder when I logged on so they must have exited at some point

though it seems that closing one of the windows causes them all to close and things to start working again when the script is run again
 
  


Reply

Tags
bash, cygwin



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Only one instance of bash script... cmfarley19 Programming 11 01-13-2018 04:41 AM
[SOLVED] escaping a single quote from a bash script atbrew Programming 8 07-21-2010 09:21 AM
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 11:10 AM
Bash script to put log files into single file and email DragonM15 Programming 13 11-08-2007 03:27 AM
Creating Single Instance linux application praj_linux Programming 2 11-19-2004 04:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration