![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unzip via bash startup script problems | easysnowboards | Shell Programming and Scripting | 0 | 05-25-2008 11:25 PM |
| How to use cygwin to run bash script | Jenny.palmy | UNIX for Dummies Questions & Answers | 6 | 04-28-2008 09:00 AM |
| How to use route command on SuSE & Cygwin | siegfried | UNIX for Dummies Questions & Answers | 3 | 04-12-2006 11:51 PM |
| Sed command in cygwin | gauri_agr | UNIX for Dummies Questions & Answers | 2 | 07-27-2005 12:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 Cygwinon 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/BKerniganas 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/scriptHere, 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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |