get_mapped_file
Purpose:
-
Retrieve and print the mapped file location for a given keyword from a configuration file.
Enter:
-
get_mapped_file <keyword>
Where:
-
keyword
Specify the keyword string located in the configuration file associated with the requested file location.
Example:
-
get_mapped_file @WORLD_DRIVE
The above command results in ‘//2/world/drive’ being printed on STD_OUT.
Notes:
-
If the keyword is not found, the program outputs ‘NOT FOUND’. If no keyword is provided, it outputs ‘NO KEYWORD ENTERED’
A keyword can be determined by looking at the file /data/cell_map_location or you can enter the command ‘map_keywords’. The following is an example of how to use this command in a script file, called get_map, that needs to know where the world drive is located.
#!/bin/sh
file=‘get_mapped_file $1’
if [ ‘”$file”’ = ‘NOT FOUND’ ]
then
echo get_mapped_file could not find keyword=$1
exit
else
if [ “$file” = ‘NO KEYWORD ENTERED’ ]
then
echo Missing KEYWORD argument to get_mapped file
exit
fi
fi
# do what ever you need to do on the world drive
.To use the above script, enter the following in the command line:
get_map @WORLD_DRIVE