Author |
Message |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
Hi all, I do a lot of scripting to automate tasks and I find myself doing a fair amount of string manipulation, for the most part I write bourne shell scripts, and anything a little heavier I'll write a bash script, if I need more functionality, the next weapon in my @rsenal is Java, which is quite a step up... I'm thinking I should really learn another scripting language, something more concise than bash (I can do pretty much anything in bash, it's just not particularly clean!). I'm not really looking for portability between different systems seeing as I'll be using OS specific commands, but transferable skills are always good  I see a lot of people using Perl around the office, and that looks horrid...Python creeps in every now and again... So what do you guys use? Have you heard one is better than another? Cheers, Ben
Last edited by forquare1 on Thu May 28, 2009 1:12 pm, edited 2 times in total.
|
Thu May 28, 2009 10:56 am |
|
 |
EddArmitage
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 9:40 pm Posts: 5288 Location: ln -s /London ~
|
I tend to use python. I also like how the overzealous filter blocks @rsenal! Better to be safe than sorry, I guess, though!
Edd
|
Thu May 28, 2009 11:11 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
I'm going to have a look at Python, last time I looked I saw it from a programming view and I felt it lacked structure (compared to Java), this time I will be looking at it from a scripting viewpoint, so hopefully I'll get on with it better...
|
Thu May 28, 2009 11:20 am |
|
 |
Nick
Spends far too much time on here
Joined: Thu Apr 23, 2009 11:36 pm Posts: 3527 Location: Portsmouth
|
So it will block Arsenal (Ar senal) but not prick, cock, or twat? p.s. I've got nothing useful to add to this thread, and for those reasons ... I'm out.
_________________
|
Thu May 28, 2009 4:52 pm |
|
 |
ShockWaffle
Doesn't have much of a life
Joined: Sat Apr 25, 2009 6:50 am Posts: 1911
|
Have you considered Ruby? For text manipulation it can do some very complex [LIFTED] in a single line script.
|
Sat May 30, 2009 7:35 pm |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
I hadn't, I presume it's similar to Perl/Python in execution? (Ie make it executable and do ./filename) I always thought, probably wrongly, that Ruby was far more of a web scripting language?
|
Sat May 30, 2009 8:59 pm |
|
 |
AlunD
Site Admin
Joined: Fri Apr 24, 2009 6:12 am Posts: 7011 Location: Wiltshire
|
You are correct its web based. Ruby is in fact AJAX in other words java script.
_________________ <input type="pickmeup" name="coffee" value="espresso" />
|
Sun May 31, 2009 6:53 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
Corrected...It may have moved on, but when I learnt ECMAscript a couple of years back, it was a horrible language with meaningless errors. I swear I copied a piece of code character for character, I did a diff on it and it came out the same, yet it didn't work...I copied and pasted the code and it worked  One important thing which I have overlooked, can I use environment tools in these languages? If I want to do the following, could I? I'm sure each language brings it's own manipulation tools which would act like awk, but can I get the ls functionality?
|
Sun May 31, 2009 8:55 am |
|
 |
AlunD
Site Admin
Joined: Fri Apr 24, 2009 6:12 am Posts: 7011 Location: Wiltshire
|
in terms of PHP,Java script, Ajax and Python ( I think ) They are server side so I don't see how they could use or see local client side machine details ( if that's what you are trying to do ).
_________________ <input type="pickmeup" name="coffee" value="espresso" />
|
Sun May 31, 2009 9:18 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|

Ahhh, I'm not after web scripting at all  I want an alternative for shell scripts, for example: I currently have a smallish shell script which indexes a given directory and sub directories, I want to expand this to it indexes them into an XML file, later I will want to create a program which can add other data (meta data) to the XML file, and then will eventually be looking at making a script which will create/update a webpage based on the content of the XML file. I can do this in shell script, but there is a fair amount of manipulation to be done with regards to paths and file names, and it looks very hacky, for example: I need something that can interact with 'system commands', such as `ls`, `find`, zfs commands, `fmadm faulty`, etc. to give me information about the system, a lot of these scripts will be run by cron, I could pass the data in as an argument, but it seems clunky to do that...I would also like it to be less hacky than shell scripts, they do everything I want, but it's not clean at all...
|
Sun May 31, 2009 9:50 am |
|
 |
AlunD
Site Admin
Joined: Fri Apr 24, 2009 6:12 am Posts: 7011 Location: Wiltshire
|
Probably a silly question why don't you a small java or VB application to do it?
_________________ <input type="pickmeup" name="coffee" value="espresso" />
|
Sun May 31, 2009 10:37 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
Only because Java feels to industrial for the job, it's almost too structured... It shouldn't take a lot, seems a bit much to start getting Java involved, but it's a little too much for bash, I was after a middle ground...Although I do know that Java will be able to use `ls, `find`, etc....
I'm going to have a closer look at Python at some point, and I'll probably take a peek at Ruby too...
|
Sun May 31, 2009 10:46 am |
|
 |
ShockWaffle
Doesn't have much of a life
Joined: Sat Apr 25, 2009 6:50 am Posts: 1911
|
I think you are confusing Ruby with Rails. Ruby is a fully object oriented scripting language that runs on any machine you like, is popular (albeit it less so than Python and Perl) for system administration tasks, and includes precisely zero Java Script. Ruby on Rails is something else, about which I know little because I'm not interested in web development atm.
|
Sun May 31, 2009 11:08 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5150 Location: /dev/tty0
|
Cool, Ruby will certainly be looked at then 
|
Sun May 31, 2009 11:19 am |
|
 |
AlunD
Site Admin
Joined: Fri Apr 24, 2009 6:12 am Posts: 7011 Location: Wiltshire
|
 Right in one yes. 
_________________ <input type="pickmeup" name="coffee" value="espresso" />
|
Sun May 31, 2009 12:22 pm |
|
|