0

am trying to run the cygwin command in a windows batch file, however, the cygwin command only reaches to the cygwin interactive promt.

my code is as follows in the windows bat file

@echo off C: chdir C:\cygwin\bin bash --login -i split -l 1 test.txt logoff exit 

it only reaches to the command interface for cygwin/linux command prompt reached

1
  • I'm not sure what your issue is, because you've not fully explained it, but I assume that you've not got a file xaa after this script finishes. Is there a file named text.txt residing in C:\cygwin\bin? or does the login via bash automatically change the current working directory to another one? Or are you expecting that the commands which follow bash … are all executed within bash, despite those lines being invoked under cmd? Commented Jun 1, 2020 at 9:44

1 Answer 1

2

When you use bash --login -i, you enter in an interactive bash shell.

What you need is :

bash -c "cd /path/to/your-test-txt; split -l 1 test.txt" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.