Computer Bodgers and Tinkerers

SharkBait

Member (lol "member")
Just wondering how many of you here don't baulk at the idea of using a command prompt or even running Linux instead of Windows?

Seems I can't help but mess and do things the hard way just to learn a thing or two.
 

tek-monkey

wanna see my snake?
I just used it then to batch encode some videos, as I can't be bothered to work out how to do it in the GUI!
 

hop

Well-Known Forumite
First thing I install on any windows machine is Cygwin. The standard windows shell it too poor for any serious automation and lacks SSH.

Having said that I have been using powershell recently and find some tasks are simpler and quicker in that than using a typical Korn Shell with a bit of Sed / Awk and Perl to process the pipeline.
 

Ecker

Well-Known Forumite
First thing I install on any windows machine is Cygwin. The standard windows shell it too poor for any serious automation and lacks SSH.

Having said that I have been using powershell recently and find some tasks are simpler and quicker in that than using a typical Korn Shell with a bit of Sed / Awk and Perl to process the pipeline.


Please don't use TLAs
 

wmrcomputers

Stafford PC & laptop repair specialist
Bodging and tinkering is always the best way to learn I think. It's certainly where I've built my own "knowledgebase" from.

(although having said this, tinkering a bit too much landed me with 4 children. I should have tinkered, then stopped!) ;)
 

hop

Well-Known Forumite
Please don't use TLAs
They aren't particularly TLAs. These are the names of simple domain specific languages and should in the tool belt of anyone who considers them self a power user or programmer. In unix like environments you can treat the output of commands as a string of text and process it in a pipeline.
SED is a simple way to send in input, manipulate it via regular expressions and receive output which might then be piped to another command.
AWK is again a simple text processing language.

So lets say you were creating a shell script to install a program. As part of the script you might want to download some code from a GIT repository. You might want to check the version of the git client installed for which you can use the command "git --version"

$ git --version
git version 1.7.5.4

Now the output of this command contains extra information which you don't require so to get the specific version you might pipe the output to awk

$ git --version | awk '{print $3}'
1.7.5.4


Since this thread started off about using a command shell, I don't believe it is possible to use the shell in a powerful way without the need to call into external libraries which will mean knowledge of the likes of SED, AWK, Perl, grep and general regular expressions. On windows it used to be necessary to use Cygwin to provide a unix emulation layer and provide a powerful shell however you can now largely use powershell to accomplish the same.
 

SharkBait

Member (lol "member")
Actually started using Cygwin again after it being mentioned upthread.

I'm actually trying to read a couple of books in order to try and achieve a higher state of geekdom. I know, right!
 

hop

Well-Known Forumite
Actually started using Cygwin again after it being mentioned upthread.

Very admirable.

Your a photographer wouldn't your needs be better catered for in something like python ? Not sure what you use to script photoshop since I use the gimp which you can definitely script in python.

Python is a good language with some great features such as.
- REPL - read, eval, print, loop
- list comprehension
- generators
- lambdas

Writing in python you can get things done quickly and if you have a performance critical part you can jut write that bit in c/c++ and expose it so you can call it from python.

There used to be a good intro to python called 'Dive into Python' authored by Mark Pilgrim which might still be available online. Unfortunately Mark made the decision to commit internet suicide a few years ago. At this point his content was removed and he ceased to maintain an online presence. That all happened a few years ago now though so I would think someone will have put the content back online.
 

tek-monkey

wanna see my snake?
I may be wrong, but the raspberry pi lot were on about pushing python. I'd expect a lot of guides over there aimed at all levels, but I've not looked for a while.
 

hop

Well-Known Forumite
As I suspected others have mirrored the work.

Nice intro to python.

If you use OSX and Picassa / Google + I have some polyglot code I wrote a few years ago which glues applescript together with python so that you can enable interoperation between iPhoto and Picasas REST API - the code updates the Geotag information on picasa. That might be of interest to a photographer.
 

SharkBait

Member (lol "member")
Most my photo work is in Lightroom/Photoshop. Somewhere further down the list is using a command line to drive Photoshop automation. At the top of my list is writing a cron job to backup wordpress websites. Only got as far as writing some pseudo code - will be a shell script that reads a configuration file. The configuration file will detail the ftp server/MySQL server and login credentials and the backup frequency.

Interesting food for thought all the same :)
 
Top