LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 10-17-2007, 05:18 PM   #1
rep29
LQ Newbie
 
Registered: Oct 2007
Posts: 0

Rep: Reputation: 0
Bash on Windows?


I hope this is the right forum for this topic...it didn't really seem to fit in any of the others.

Basic Question:
Is there an easy way to run simple bash scripts calling only a few commands on Windows without installing a full emulator?

Details:
I have a bash script that is designed to help a friend with a Windows computer issue. It is one line long, and only calls a few linux commands. (So I don't need to be able to call awk, grep, ls, rm, etc.) Since I don't have physical access to the computer, it would be too complicated to boot into a live cd, or install something like cygwin--I'm looking for something simple for the end user. (Something that I can load up into a folder and have a single "Click here" batch file that does everything.) I've tried UnixUtils, but that didn't work with my script. All the script does is call the find command and format the output through sed and a few other commands. I just assumed that it would be easy to port over to Windows, but none of the Windows emulators will execute the script, which works fine on OS X.

I'm looking for a standalone bash environment that will run my script and point the appropriate commands to the right executables. All of the programs have been ported to windows.

I'd greatly appreciate any help with this problem.
 
Old 10-17-2007, 05:20 PM   #2
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
http://www.cygwin.com/

Don't need to do a full install
 
Old 10-17-2007, 05:25 PM   #3
rep29
LQ Newbie
 
Registered: Oct 2007
Posts: 0

Original Poster
Rep: Reputation: 0
How can you do a partial install? Did I miss something in the documentation? Also, even when I do a full install, it doesn't work. None of the commands work when I launch the shell--not even ls.

R.E.P.
 
Old 06-10-2009, 05:46 PM   #4
pri4pus
LQ Newbie
 
Registered: May 2009
Posts: 0

Rep: Reputation: 0
Thumbs down Don't ask ridiculous questions!

Quote:
Originally Posted by rep29 View Post
I hope this is the right forum for this topic...it didn't really seem to fit in any of the others.

Basic Question:
Is there an easy way to run simple bash scripts calling only a few commands on Windows without installing a full emulator?

Details:
I have a bash script that is designed to help a friend with a Windows computer issue. It is one line long, and only calls a few linux commands. (So I don't need to be able to call awk, grep, ls, rm, etc.) Since I don't have physical access to the computer, it would be too complicated to boot into a live cd, or install something like cygwin--I'm looking for something simple for the end user. (Something that I can load up into a folder and have a single "Click here" batch file that does everything.) I've tried UnixUtils, but that didn't work with my script. All the script does is call the find command and format the output through sed and a few other commands. I just assumed that it would be easy to port over to Windows, but none of the Windows emulators will execute the script, which works fine on OS X.

I'm looking for a standalone bash environment that will run my script and point the appropriate commands to the right executables. All of the programs have been ported to windows.

I'd greatly appreciate any help with this problem.
For further readers of the post who have the same question:
Don't be ridiculous, make a script for Windows cmd (*.bat) file.
 
Old 06-11-2009, 12:05 PM   #5
rep29
LQ Newbie
 
Registered: Oct 2007
Posts: 0

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pri4pus View Post
For further readers of the post who have the same question:
Don't be ridiculous, make a script for Windows cmd (*.bat) file.
That would require that cygwin be installed on the friend's computer, or the commands would return an error. You can't call grep from the windows command line. You can create all the *.bat files you want, but the programs they call need to be accessible. That was my problem - windows doesn't have a good set of command line tools available.

What I ended up doing was extracting the programs that I needed from cygwin and GNU and the libraries those programs required. Everything was put into a zip file. My friend extracted the zip file into a folder, and ran the *.bat file.

It was not an elegant solution, but it worked.
 
Old 06-11-2009, 12:47 PM   #6
peonuser
Member
 
Registered: Mar 2008
Location: Where ever I am.
Distribution: Various
Posts: 173
Blog Entries: 139

Rep: Reputation: 21
Quote:
Originally Posted by rep29 View Post
That would require that cygwin be installed on the friend's computer, or the commands would return an error. You can't call grep from the windows command line. You can create all the *.bat files you want, but the programs they call need to be accessible. That was my problem - windows doesn't have a good set of command line tools available.

What I ended up doing was extracting the programs that I needed from cygwin and GNU and the libraries those programs required. Everything was put into a zip file. My friend extracted the zip file into a folder, and ran the *.bat file.

It was not an elegant solution, but it worked.
I think what he is suggesting is forget bash and use the native mswindows type batch files. I am not sure whether kde4 for windows will let you use bash also. Something to consider.
 
Old 11-27-2009, 01:21 AM   #7
pri4pus
LQ Newbie
 
Registered: May 2009
Posts: 0

Rep: Reputation: 0
Google search?!

Quote:
Originally Posted by rep29 View Post
I hope this is the right forum for this topic...it didn't really seem to fit in any of the others.

Basic Question:
Is there an easy way to run simple bash scripts calling only a few commands on Windows without installing a full emulator?

Details:
I have a bash script that is designed to help a friend with a Windows computer issue. It is one line long, and only calls a few linux commands. (So I don't need to be able to call awk, grep, ls, rm, etc.) Since I don't have physical access to the computer, it would be too complicated to boot into a live cd, or install something like cygwin--I'm looking for something simple for the end user. (Something that I can load up into a folder and have a single "Click here" batch file that does everything.) I've tried UnixUtils, but that didn't work with my script. All the script does is call the find command and format the output through sed and a few other commands. I just assumed that it would be easy to port over to Windows, but none of the Windows emulators will execute the script, which works fine on OS X.

I'm looking for a standalone bash environment that will run my script and point the appropriate commands to the right executables. All of the programs have been ported to windows.

I'd greatly appreciate any help with this problem.
Have you at least tried to do a google search?
For example I have found this:
win-bash
 
Old 11-27-2009, 04:41 AM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

Rep: Reputation: 892Reputation: 892Reputation: 892Reputation: 892Reputation: 892Reputation: 892Reputation: 892
Moved: This thread is more suitable in <GENERAL> and has been moved accordingly to help your thread/question get the exposure it deserves.



And that said: Dear OP, I think you're suffering a bit of a misconception.
bash is a glue, a way of "binding programs together". Installing anything
bash-like won't cut the cheese. And short of installing cygwin including
all the programs your bash-script uses (not that I know what you're actually
making use of) it's not going to fly.



Cheers,
Tink
 
Old 11-27-2009, 05:17 AM   #9
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 443

Rep: Reputation: 56
I like to bash windows all the time.
(Just couldn't resist :P)

Hmm, so you don't need Bash for anything else then fixing a computer once? I thought windows xp and beyond included a remote desktop thingy. Perhaps if you guided him to activate it, you could do what the script does manually?
 
Old 11-27-2009, 06:22 AM   #10
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,076
Blog Entries: 52

Rep: Reputation: Disabled
GnuWin32 provide stuff that can be used with Windows command line (cmd.exe), so presumably, in .BAT files too.

http://gnuwin32.sourceforge.net/packages.html
 
Old 11-27-2009, 12:36 PM   #11
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,234

Rep: Reputation: 184Reputation: 184
how about MSYS?
 
Old 11-28-2009, 11:58 PM   #12
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 304

Rep: Reputation: 33
Yeah get MSYS. I used to run MinGW and MSYS on Windows XP and it pretty much acted like a bash shell.
http://www.mingw.org/

Oh yeah I actually made a tutorial. Maybe it is terrible, I don't know. I mostly just make the tutorials for when I forget how to do stuff months later and I don't want to relearn it.
http://www.icecubeflower.com/mingw.html

Last edited by icecubeflower; 11-29-2009 at 12:01 AM.
 
Old 11-29-2009, 12:12 AM   #13
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 304

Rep: Reputation: 33
...wait this thread is two years old. Who am I even talking to?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Windows native bash-like script language koyi Programming 13 01-24-2006 11:24 PM
BASH software 4 windows shift21 General 3 08-29-2004 12:47 AM
BASH software 4 windows shift21 Linux - Newbie 4 08-28-2004 10:58 AM
console like bash for windows biiiep General 3 07-16-2004 02:38 AM
X-Windows config from bash Ezekiel Linux - Newbie 1 04-24-2002 12:03 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration