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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-22-2006, 10:46 PM
|
#1
|
|
Member
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421
Rep:
|
Windows native bash-like script language
Hi, I am wondering if there are script languages like bash/perl/php that comes with windows?
I know all 3 of the above languages can be used under windows, and they run natively but what I am looking for is something more "native" to windows in the sense that it comes with, or supported by Microsoft directly so that you don't have to install anything to program or to run the scripts.
Regarding the console world in windows, all I know is DOS, but I don't think it is a powerful tool.
Any opinions are welcome.
Thanks.
|
|
|
|
01-22-2006, 11:36 PM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,084
Rep: 
|
You can download Cygwin from http://www.cygwin.com/. It takes a while to download all of the packages, but it works just fine (eventually  )
|
|
|
|
01-22-2006, 11:44 PM
|
#3
|
|
Senior Member
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Rep:
|
VBScript? Not sure if it ships with all versions of Windows or not though.
|
|
|
|
01-23-2006, 01:38 AM
|
#4
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
|
|
|
|
01-23-2006, 03:21 AM
|
#5
|
|
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851
Rep:
|
Perl is available in a Windows Port: http://www.cpan.org/ports/#win32
ActivePerl I've used and like 
Also, Java can be used to build console applications, if that helps any.
Hope this helps
Edit: Just re-read the post, and that probably doesn't help much...
The closest thing you are going to get without a third-party application is batch scripts... but these pale terribly in comparison to anything listed in your post...
Last edited by scuzzman; 01-23-2006 at 03:23 AM.
|
|
|
|
01-23-2006, 07:22 AM
|
#6
|
|
Member
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421
Original Poster
Rep:
|
Thanks for the replies guys
I will check out about VBscript when I have the time.
Just for your information, The reason why I want it to be available on windows is that I want to write some utilities for my friends. I don't think it is a good idea to ask them to install perl/PHP/cygwin or whatever just to run those little scripts.
Thanks again.
|
|
|
|
01-23-2006, 07:29 AM
|
#7
|
|
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851
Rep:
|
There is one more option: HTA files. These work well as primitive GUI programs that can do quite a few complex functions through Javascript and VBScript... http://msdn.microsoft.com/workshop/a...taoverview.asp
|
|
|
|
01-23-2006, 08:23 PM
|
#8
|
|
Member
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197
Rep:
|
Quote:
|
Originally Posted by koyi
Hi, I am wondering if there are script languages like bash/perl/php that comes with windows?
I know all 3 of the above languages can be used under windows, and they run natively but what I am looking for is something more "native" to windows in the sense that it comes with, or supported by Microsoft directly so that you don't have to install anything to program or to run the scripts.
Regarding the console world in windows, all I know is DOS, but I don't think it is a powerful tool.
Any opinions are welcome.
Thanks.
|
VBScript is what you want to use. Along with WSH (Windows Scripting Host), you can pretty much accomplish most things you would use bash/perl/python to do, though I find you end up writing a bit more code in some cases. VBScript is more like a glue language, in that it doesn't really have many useful libraries build into it (in contrast to perl or python), but with the CreateObject() function, you have access to boatloads of the standard ActiveX objects that come preinstalled on most Windows machines.
It is not a very modular language, though, so it is best for short, administrative type scripts, in my optinion.
|
|
|
|
01-24-2006, 10:52 AM
|
#9
|
|
Senior Member
Registered: Dec 2004
Location: Bawstun area
Distribution: Suse (10.2, 10.3), CentOS, and Ubuntu
Posts: 1,794
Rep:
|
Would you be happy with Korn and C shells? if so then download Microsoft Services for Unix from http://www.microsoft.com/windowsserv...u/default.mspx
|
|
|
|
01-24-2006, 10:58 AM
|
#10
|
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
Who needs Perl.. I do everything by writing batch files..

|
|
|
|
01-24-2006, 09:06 PM
|
#11
|
|
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851
Rep:
|
Because I can do this with Perl... and you cannot with a batch file without installing third-party command-line utilities...
Code:
sub fix_id3 {
# Here's where the magic is done
$album = $_[0];
$artist = $_[1];
$genre = $_[2];
$file = $_[3];
print "What is the track name? ";
chomp ( $title = <STDIN> );
# wrap the object constructor call in an eval to
# make sure we catch any weird errors and object was
# created ok
eval {
$mp3 = MP3::Tag->new($file); # Creates new object
};
# Make sure the object was created OK
if ($@) {
die qq{Error creating MP3 object, $@}; # if not, die and tell us why
}
unless ( exists $mp3->{ID3v1} ) { # assure ID3v1 is a valid option
$mp3 -> new_tag("ID3v1");
$mp3 -> {ID3v1}->write_tag; # otherwise, create it
}
$mp3 -> {ID3v1} -> title("$title"); # adds element title
$mp3 -> {ID3v1} -> artist("$artist"); # adds element artist
$mp3 -> {ID3v1} -> album("$album"); # adds element album
$mp3 -> {ID3v1} -> genre("$genre"); # adds element genre
$mp3 -> {ID3v1} -> write_tag(); # writes the tags
$mp3 -> close(); # close the file
# we'll also rename the files
$oldname = "$file";
$newname = "${artist} - ${title}.mp3";
rename $oldname, $newname;
print "\n";
}
|
|
|
|
01-24-2006, 09:12 PM
|
#12
|
|
Senior Member
Registered: Dec 2004
Location: Bawstun area
Distribution: Suse (10.2, 10.3), CentOS, and Ubuntu
Posts: 1,794
Rep:
|
Oh by the way - perl is available for Windows (in addition to the version bundled with Services for Unix). Check out ActivePerl at http://www.activestate.com/Products/ActivePerl/
|
|
|
|
01-24-2006, 10:13 PM
|
#13
|
|
Member
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421
Original Poster
Rep:
|
Thanks for all of the information.
I will try to choose one from the above suggestions
Of course if you have extra information to provide.
Please do so so that other people can take advantage of this post, too 
|
|
|
|
01-24-2006, 10:24 PM
|
#14
|
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
>> Because I can do this with Perl... and you cannot with a batch file without installing third-party command-line utilities...
once again sarcasm goes soaring over the head of an intended audience..
i know i should have used <joking> tags.. forgot where i was for a second..
|
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:08 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|