The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unzip via bash startup script problems easysnowboards Shell Programming and Scripting 0 05-26-2008 02:25 AM
How to use cygwin to run bash script Jenny.palmy UNIX for Dummies Questions & Answers 6 04-28-2008 12:00 PM
How to use route command on SuSE & Cygwin siegfried UNIX for Dummies Questions & Answers 3 04-13-2006 02:51 AM
Sed command in cygwin gauri_agr UNIX for Dummies Questions & Answers 2 07-27-2005 03:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2007
fabulous2 fabulous2 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 30
cygwin bash startup command weirdness (part 1)

I am running (I believe) the latest stable version of cygwin
CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
on a win xp sp2 laptop.

Suppose, to make things simple for now (but I may do a part 2 posting...), that I am in a dos shell, and I want to create a bash shell and have it execute a few commands before closing and returning to the dos prompt.

I have experimentally found that this (dos) command line does the trick:
c:\cygwin\bin\bash.exe --login -c "pwd && ls -a"
It outputs
/home/BKernigan
. .. .bash_history .bash_profile .bashrc .inputrc
as expected, and then closes and returns to dos. Note that the working directory is my home directory, /home/BKernigan, and that its contents (all bash related config files) are correctly listed.

This (dos) command line
c:\cygwin\bin\bash.exe -i -c "pwd && ls -a -l"
(same as above except that -i replaces --login) partially works; it outputs
/cygdrive/d/unix/nextVersion/script
bash: ls: command not found
Here, it thinks that the working directory is the directory where I created the dos shell (d:\unix\nextVersion\script), as opposed to my cygwin home, so that is one difference from the --login version. And then, for some bizarre reason, the ls command is not found! Hmm, how can it find the pwd command but not ls? Note that the ls command really is in my cygwin installation (this is known both because the ls command in the first example worked, and I can also assure you that ls.exe is found in C:\cygwin\bin).

Does anyone have any idea what is going on here???

The web research that I did does not seem to answer this question. (The best single reference being the generic bash reference Bash Reference Manual: Invoking Bash, but I found it to be quite complex.)

Forgive me in advance if this is such an obvious error on my part.

Also, if this is not the best forum--or even the best website--for this question, by all means suggest to me where I should go and I will repost it there.
  #2 (permalink)  
Old 05-19-2008
swapsawe swapsawe is offline
Registered User
  
 

Join Date: May 2008
Posts: 1
Ensure Path Settings

Ensure that you have set your PATH variable(in MyComputer) to point to %CYGWIN_HOME%/bin

When you are planning to run the shell script, ensure, you have sh.exe present in your %CYGWIN_HOME%/bin. you can get this file from http://russell.vcharite.univ-mrs.fr/...ts4-cygwin.zip

HTH,

SwapSawe
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0