Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

help with script (unix/windows paths)

  • 20-06-2005 12:46pm
    #1
    Moderators, Arts Moderators Posts: 35,741 Mod ✭✭✭✭


    I'm trying to automate a process and can't decide between a DOS-only approach, unix-only or a mixture of the two. Has anyone any tops for the following?

    I want to take two windows-style paths, extract a couple of arguments from them and create directories using these arguments. e.g. the files are currently on:

    g:\projectnumber\filetypes\subtype\batchnumber1 and
    g:\resources\othertype\batchnumber2

    I want to create paths called

    d:\projectnumber\batchnumber1 and
    d:\projectnumber\resources\batchnumber2 and copy the files into them

    I can do this with cut, mkdir and cp, but it's a bit of a pain having to wrap the windows-paths in quotes all the time.

    Next I want to launch a Windows executable (probably via a batchfile) and pass some of these parameters to it.

    This is probably very vague, but I'm wondering is there any way to do all this in one script, or by getting a unix script to create a batch file then run it?


Comments

  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    I'm trying to automate a process and can't decide between a DOS-only approach, unix-only or a mixture of the two. Has anyone any tops for the following?

    I want to take two windows-style paths, extract a couple of arguments from them and create directories using these arguments. e.g. the files are currently on:

    g:\projectnumber\filetypes\subtype\batchnumber1 and
    g:\resources\othertype\batchnumber2

    I want to create paths called

    d:\projectnumber\batchnumber1 and
    d:\projectnumber\resources\batchnumber2 and copy the files into them

    I can do this with cut, mkdir and cp, but it's a bit of a pain having to wrap the windows-paths in quotes all the time.

    Next I want to launch a Windows executable (probably via a batchfile) and pass some of these parameters to it.

    This is probably very vague, but I'm wondering is there any way to do all this in one script, or by getting a unix script to create a batch file then run it?

    Sounds like the perfect job for perl?


  • Moderators, Arts Moderators Posts: 35,741 Mod ✭✭✭✭pickarooney


    Yeah? Might be worth my while finally getting round to learning it... :)


Advertisement