Oct. 31st, 2012

Scripting

Oct. 31st, 2012 02:40 pm
etherial: St. Basil's Cathedral, Moscow (St. Basil's)
I've identified a procedure at work that is repetitive enough that doing it manually is error-prone and is a prime candidate for scripting. I have no experience writing Unix (Ubuntu) scripts. Here are the technical details I need help with:

1. Files are being moved from Point A to Point B. I am informed when this process begins and would like to start the script to copy some of them to my local directory (Point C) ASAP (i.e. before they are done being copied to Point B).

2. I need to extract portions of sub-folder names so I can insert them into a series of commands. (I'm sure this is a job for grep. grep is black magic.)

3. I need to extract a portion of a text file and likewise insert it into a series of commands. (See note on Item 2.)

4. Script will take foo as an argument and likewise insert it into a series of commands.

5. I need an if statement checking whether foo is greater than a certain number, with an extra line if the statement is true.

6. I want to be alerted when the files are finished copying.

October 2018

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags