Thanks Corona, that index will prove useful someday. Let me run this scenario by you guys and maybe I can get a more elegant solution than what I've been rolling with thus far.
I want to create a script that will parse out a specific string (UNC or regular folder paths) from a Robocopy log. The string searching, parsing and de-duping has all been taken care of with this one liner:
colrm removes all the junk I don't need up to the beggining of the path. Uniq de-dupes it because I have Robocopy set to retry so I generally have 2 of the same error and tr cleans up the carriage returns (if there are any) so sed can work on the strings later.
What I am left with is a file containing 1 string per line: \\foo\bar\filename.ext
The end goal is to have the folder path and file name seperated into either temprary files or into seperate array's so that I can drop them into a new robocopy batch file with the following format:
The only other piece to the puzzle is to make sure each path and file name is wrapped in quotes. To this point I have everything figured out except for separating the folder and file name.
Thanks again for your time and consideration.
Last edited by Scrutinizer; 05-23-2012 at 02:19 PM..
Reason: code tags
Hello,
I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Hi All,
Need some help in parsing a directory listing .. output into 2 files
Input file
level1,/level2/level3/level4/ora001,10,IBB23
level1,/level2/level3/level4/ora001/blu1,,IBB23
level1,/level2/level3/level4/ora001/clu1,,IBB23
level1,/level2/level3/level4/ora002,,IBB24... (10 Replies)
Hi all,
Using sh/csh, unfortunately shell scripts are not my strong suit.
Trying to write a script that gets called from a program for pre-processing.
The program passes individual components of a UNC (//server/path1/path2/filename).
Thus the unc path of: //server/path1/path2/filename, is... (7 Replies)
I am looking to parse a text file output and set variables based on what is cropped from the parsing.
Below is my script I am looking to add this feature too.
All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
I'm trying to use Perl on Windows (Doh!) to connect to a folder on a Domain Controller via UNC.
Right now, I have
perl -e "`runas /user:DOMAIN\\Username dir \\\\SERVER\\d\$\\Path`"
This does not seem to connect nor does it prompt for password. Should I try throwing it into a script and... (0 Replies)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Hi,
I am trying to connect to a remote server using Plink tool. Both my local and remote machines are Windows. On remote server, I have OpenSSH server installed. I am able to run commands on remote machine but there is some problem with long UNC path, which I noticed today.
For... (3 Replies)
Hi all,
Hope all the expert can help me in this situation.
Let say I have one file with multiple record like below:
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST1
DIRECTORY=D:/DETAILS/1/0/test1.txt
END
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE (13 Replies)
Hi,
I have a file with about 60 lines of path:
app-defaults/boxXYZ.......
I want to change this to /my/path/goes/here/app-defaults/boxXYZ, but of course vi doesn't like the regualr :s/old/new/ command.
Is there any other quick way to do this?
Thanks ;) (2 Replies)