redirect2web [ -t ][ -m mapfile ][ -f filename ]
When a selected file is sent to the redirect2web command a web browser is started with a location resolved based on a map file.
In the map file redirect2web.map source file locations can be mapped to target web URL locations using regular expressions.
As soon as a rule in the map file matches to the selected file, the related target definition is loaded into a web browser to visualize to the user where his files he previously has used from the network drive have been saved on the web service.
The use of regular expressions in the matching rules allows to efficiently define mappings.
The redirect2web command should be installed to the 'Send To' context menu in 'Microsoft™ Windows Explorer' for most convenient usage. To do so, invoke redirect2web -i once.
Doing this, the user right clicks a file or folder in 'Microsoft™ Windows Explorer', continues with → 'Send To' → redirect2web and is then redirected to the correct new target location of the file.
If the mapfile contains spaces, it has to be surrounded by double quotes (e.g. "map file" ).
If the filename contains spaces, it has to be surrounded by double quotes (e.g. "file name" ).
The filename to test if it matches to the desired rule can be provided thru the -f filename option:
redirect2web -t -f aCalculation.xlsx
or thru stdin and the use of the -f - option:
type filelist.txt | redirect2web -t -f -
To catch the output for further processing as a csv file output, redirect stdout to a target file:
type filelist.txt | redirect2web -t -f - > result.txt
To perform a regression test of a file list (check.txt) where the first column in this example holds the rule identifier of the map file redirect2web.map that is expected to match and the 2nd holds a file name, as:
EXMP-01;g:\acct\LToons\afile.xlsx EXMP-01;g:\acct\LToons\subdir\afile.xlsx EXMP-12;g:\cust\ABC\subdir\afile.xlsx
and the related map file, invoke:
cut -d; -f2 check.txt | redirect2web -t -f - | cut -d; -f3 > result.txt cut -d; -f1 check.txt > reference.txt && fc reference.txt result.txt
If the fc (file compare) command does not find a difference between the reference.txt and the result.txt all tests are as expected.
The cut -d; -f2 command prints the 2nd field ( -f2 ) of the semicolon delimited ( -d; ) check.txt file.
The cut command is in the %PATH% when using the wtshell(1m), else it can be found in the lib/ directory of the WA2L/WinTools package.
This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.