Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: System verification Up: Code development Previous: Template management

Subsections



UP scripts to change and move code

The UP scripts' main purpose is to either change occurrences of certain patterns in the AIPS++ code (UPchange (p[*])), or to move code files from one directory to another, and update all references to the files (UPmove (p[*])). A list of files to be processed is generated in all cases most easily by the UPfind (p[*]) script (possibly with manual editing of the list).

In addition some general scripts to aid the system adiministration (UPlist (p[*]), UPreident (p[*]), UPdup (p[*]), UPlock (p[*]), UPtmpl (p[*]), UPload (p[*]), UPcasa (p[*])) exist.

Information is exchanged between the different scripts by files. These files are created in the current working directory, and all have the same name, but different extensions. The name is the code used to bind different calls together. To change all files that contain the word cat into dog, the following sequence would do that (strcat being the code name):
Find the list of files containing the word cat:

UPfind strcat 
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/nfs/aips++/weekly]: 
Specify egrep expression(s) to find files
Examples: /Measures/((MUString)|(MVAngle)|(MVTime)|(RotM)|Q|(Un))
      or: [(][^(]*[*] *[)][ \t]*0
Multi-line expressions will be ORed
Find expression: [^a-zA-Z_0-9]cat[^a-zA-Z_0-9]
Find expression: 
Specify egrep pattern for files to be removed from raw list found.
Example: [/]aipsview[/]
tmplinst files will always be removed
Remove glish files? (y|n) [y]: 
Remove pattern: 
Starting find...
9 files found in strcat.raw
Starting selected removal...
9 files left in strcat.found

The files selected, and the lines that were used in the selection, can be checked by

UPlist strcat
Getting info...
9 files found in strcat.found
Starting list...
47 lines in strcat.list

The change is then made by:

UPchange strcat
Getting info...
Specify the sed patterns used to change the contents of the files 
in the files in the strcat.found list. 
Example: s#/Measures/MV#/Quanta/MV#g
         s#[.]ac[(][)]##g
         s#at_cc[(]#(#g
         s#\([^a-zA-Z_]\)assert\([^a-zA-Z_]\)#\1assure\2#g
Change pattern: s#\([^a-zA-Z_0-9]\)cat\([^a-zA-Z_0-9]\)#\1dog\2#g
Change pattern: 
Specify the message lines for the RCS log
Example: Moved includes from Quanta to Measures
Text line: Changed the cat into the dog   
Text line: 
9 files will be changed and checked in/out
./atnf/apps/atcafiller/DOatcafiller.cc started
...

Information exchange files produced at this stage:

 strcat.def
 strcat.done
 strcat.error
 strcat.found
 strcat.list
 strcat.raw
 strcat.rcs
 strcat.rmpat
 strcat.sed
 strcat.spat

The scripts are written assuming tcsh is available at the computer used, and can be accessed by /usr/bin/env. The script may have to be changed if this is not the case. Also, the UPmove (p[*]) script uses the amv command, only available at the master site, and can only be run from there.
Note that the example outputs are only indicative, and could be different in details.

UP*

General description of the UP scripts.

Synopsis

UP* [-<switches>] [-c] [-r] [-u] [-d] [-n] <type name>

Description

Each script has the <type name> as an argument. This type name is the file name (with varying extensions) that binds the different scripts that have to cooperate together. If no type name is given, the user is prompted for one, or one that has been used already that day will be used. It is advisable to always provide a name.
Switches can be given either separately, or bunched together.
The output of the scripts is given in files with the type name as main name.

The type name act as a memory from invocation to invocation. In general once information is provided for a specific type, that information will not be asked for again (unless one of the clearing switches is present, or the communication files are deleted). Most information is script specific, but some genarl information is saved in the general definition file .def.

Options

All scripts accept the following switches; while all the scripts actually changing system information have also a -t test switch, which shows what would have happened had the script run for real.

-h
Give some useage information
-c
Clear all defining information files for the <type name> invocation of the script, and re-ask it.
-r
Clear and re-ask only the general definitions for <type name>
-u
Clear and re-ask only the specific definitions for <type name>
-d
Debug mode. Some more output could be generated by some scripts. No extensive implementation present.
-n
Will only generate the information needed to run the script, without executing the real code
-t
Available for some scripts only. When present will execute (if no -n present) the real code, but will not change the system. In general the actual change is shown in a .diff file.
-Q
A switch, mainly for internal use, that indicates that the script will run quiet, and only notify of errors, and asking questions. No informational messages (like examples of input) are given.

Examples

Help information:

UPfind -h 
Usage:   UPfind [-f] [-g] [-c] [-r] [-u] [-d] [-n] <typ>
  Get all files that contain data according to an egrep rule.
  The found files can be used in other UP scripts like UPlist, 
  UPchange etc. The <typ> is an id acting (by virtue of files) 
  as a communication between the different UP scripts.
  All .cc, .h and templates files in the code tree are searched.
Uses:    <typ>.def, <typ>.spat, <typ>.rmpat
Creates: <typ>.raw, <typ>.found
  -g use all .g files rather than the C++ files
  -f use a file pattern to search for files, not their contents
  -c clear all defining information files for this script
  -r clear only the general defining information in .def
  -u clear all but the general defining information in .def
  -d give some debug information (mostly not implemented)
  -n run script only to get defining information, without executing
  -Q run quietly
  -F force acceptance of normally asked for data
  -h this information

The following UP scripts are available:
    UPfind    [-f] [-g]      [-c] [-r] [-u] [-d] [-n] <typ>
    UPlist    [-l]           [-c] [-r] [-u] [-d] [-n] <typ>         
    UPlock    [-a] [-l]      [-c] [-r] [-u] [-d] [-n] <typ>
    UPchange  [-t]           [-c] [-r] [-u] [-d] [-n] <typ>
    UPmove    [-i] [-t]      [-c] [-r] [-u] [-d] [-n] <typ>
    UPload                   [-c] [-r] [-u] [-d] [-n] <typ>
    UPtmpl                   [-c] [-r] [-u] [-d] [-n] <typ>
    UPdup     [-s]           [-c] [-r] [-u] [-d] [-n] <typ>
    UPreident [-a] [-t] [-z] [-c] [-r] [-u] [-d] [-n] <typ>
    UPcasa

Providing only the information to run (and clear all information first):

UPfind -nc strcat
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/nfs/aips++/weekly]: 
Specify egrep expression(s) to find files
Examples: /Measures/((MUString)|(MVAngle)|(MVTime)|(RotM)|Q|(Un))
      or: [(][^(]*[*] *[)][ \t]*0
Multi-line expressions will be ORed
Find expression: [^a-zA-Z_0-9]cat[^a-zA-Z_0-9]
Find expression: 
Specify egrep pattern for files to be removed from raw list found.
Example: [/]aipsview[/]
tmplinst files will always be removed
Remove glish files? (y|n) [y]: 
Remove pattern:

Providing only the information to run (and clear general information first, and re-use other information):

UPfind -n -r strcat
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/nfs/aips++/weekly]:

Providing only the information to run (and re-use all information):

UPfind -n strcat
Getting info...

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPfind

Find files in system code tree. File list to be used in action UP scripts.

Synopsis

UPfind [-g] [-f] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPfind script finds all files in the AIPS++ code tree (normally in the .{h,cc} files, but see the -g flag) that contain the specified pattern. The files found will be stored in the <type name>.raw file. A filter is applied to leave files to be processed in the <type>.found file.

The information supplied in answer to questions asked will be stored as well, for the use in subsequent scripts with the same <type>.

Options

-g
Look for files in .g rather than .h, .cc and templates files.
-f
Generate the file list from a set of file patterns, rather than a set of egrep patterns. The file patterns should be rooted at AIPSROOT/code.

Examples

UPfind -h
Usage:   UPfind [-f] [-g] [-c] [-r] [-u] [-d] [-n] <typ>
  Get all files that contain data according to an egrep rule.
  The found files can be used in other UP scripts like UPlist, 
  UPchange etc. The <typ> is an id acting (by virtue of files) 
  as a communication between the different UP scripts.
  All .cc, .h and templates files in the code tree are searched.
Uses:    <typ>.def, <typ>.spat, <typ>.rmpat
Creates: <typ>.raw, <typ>.found
  -g use all .g files rather than the C++ files
  -f use a file pattern to search for files, not their contents

See the general introduction for an extensive example

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPlist

List the content of files found by the UPfind command.

Synopsis

UPlist [-l] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPlist script lists all the files listed in the <typ>.found file. Only those lines are listed that contains the selection pattern from the UPfind command. The list is given in <type>.list. The command can be used to check the selection of files before actually changing or moving files, but is also valid in its own right.

Options

-l
Provide a line number in the file lists as well.

Examples

UPlist -h
Usage:   UPlist [-l] [-c] [-r] [-u] [-d] [-n] <typ>
  List all lines that have been found using an egrep rule in
  <typ>.spat. The files are given in <typ>.found.
  In general the pattern and files are listed using UPfind.
Uses:    <typ>.def, <typ>.spat, <typ>.found
Creates: <typ>.list
  -l will give the line numbers in the files

Using the find information from the general introduction, we get:

UPlist
Assuming <typ> as 'strcat'.
Getting info...
9 files found in strcat.found
Starting list...
47 lines in strcat.list

cat strcat.list
1000 ## ./atnf/apps/atcafiller/DOatcafiller.cc
1001 ## ./bima/apps/bimafiller/bimafiller.cc
1002 ## ./nrao/apps/gbtobsparser/GBTObsSymtab.h
1003 ## ./aips/implement/Utilities/test/tString.cc
1004 ## ./aips/implement/Utilities/String.cc
1005 ## ./trial/implement/MeasurementSets/MSConcat.cc
1006 ## ./trial/implement/MeasurementSets/MSFitsInput.cc
1007 ## ./trial/implement/MeasurementSets/FitsIDItoMS.cc
1008 ## ./trial/apps/aipsview/AvString.cc
1000 ::   Vector<String> cat(nCat);
1000 ::   cat(0)="FLAG_CMD";
1000 ::   cat(1)="ORIGINAL"; 
1000 ::   cat(2)="USER"; 
1000 ::   msc_p->flagCategory().rwKeywordSet().define("CATEGORY",cat);
1001 ::   Vector<String>  cat(nCat);
...

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPlock

Check and report if files are locked.

Synopsis

UPlock [-a] [-l] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPlock script lists all the files that are locked in the master. Listed in <type>.lock are either the files in the <typ>.found file that are locked in the AIPS++ master tree, or all locked files. The command can be used to check the status of files before actually changing or moving files, but is also valid in its own right. If the command is run from a local installation, it is assumed that the user has an account at the aoc aips master suitable for ssh (i.e. if you are able to do rao). If the account name differs from the local name, the $AUID environment variable has to be set with the remote user name (like for rao).

Options

-a
Show all locked files, rather than the selection based on the <type>.found list
-l
Provide the locker and the revision level in addition to the file name.

Examples

UPlock -h
Usage:   UPlock [-a] [-l] [-c] [-r] [-u] [-d] [-n] <typ>
  Test for each locked file if it is in the list of files
  <typ>.found (as created with UPfind), and output the 
  result in the file <typ>.locked.
Uses:    <typ>.def, <typ>.found
Creates: <typ>.locked
  -a display all locked files, rather than a selection based
     on <typ>.found
  -l show the locker and revision number as well

Get all locked files and their lockers:

  UPlock ct -la
  Getting info...
  Finding locked files...
  201 files in ct.locked

  cat ct.locked
  akemball 15.0 ./aips/implement/MeasurementSets.h
  akemball 15.0 ./bima/apps/bimafiller/bimafiller.g
  akemball 15.0 ./bima/apps/bimafiller/bimafiller.help
...

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPcasa

Return the list of basic casa library packages..

Synopsis

UPcasa

Description

The UPcasa script lists all the basic casa library packages in hierarchal order. The command is an easy way to get the hierarchal list of casa library packages.

Options

Examples

UPcasa
casa scimath tables measures fits lattices 
coordinates components images ms msvis 
calibration ionosphere flagging dish 
simulators synthesis graphics tasking

Author

Original: 2004/10/15 by Wim Brouw, ATNF


UPchange

Change source files in AIPS++ master, using a list of files, probably created by UPfind.

Synopsis

UPchange [-t] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPchange script changes all the files given in <type>.found, using the editor pattern provided. Successful changes are recorded in <type>.done, unsuccesful ones in <type>.error. If the -t test switch is given, no real changes are made, but the differences are recorded in <type>.diff.

Options

-t
Do only a test run. Files are checked out and changed, but rather than checking the changed files in again, the differences created are recorded.

Examples

UPchange -h
Usage:   UPchange [-t] [-c] [-r] [-u] [-d] [-n] <typ>
  Update all files given in the <typ>.found list (which is
  normally created by UPfind). Updating means that files
  will be checked out, changed and checked in again.
  <typ>.done and <typ>.error will contain the files successfully
  done or not.
Uses:    <typ>.def, <typ>.found, <typ>.sed, <typ>.rcs
Creates: <typ>.done, <typ>.error, <typ>.diff
  -t will run a test mode, where files are checked out,
     changed, but not checked in again. A file <type>.diff will
     be created showing what would have been changed.

See the general introduction for an extensive example

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPmove

Move source files in AIPS++ master, using a list of files, probably created by UPfind. The files will be moved from one path to another, updating all files referencing these files as well.

Synopsis

UPmove [-i] [-t] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPmove moves files in the AIPS++ code tree from one place (and/or name) to another. At the same time it will change all references to that file in the system as well. The output of the script is a list of files that were successfully changed in <type>.done, and in <type>.error for unsuccessful ones. If the -t test switch is given, the <type>.diff will give differences that would have been made when the file is run for real.
If files are actually moved, the script must be run from the aoc master, since amv is involved (see UPload (p[*]) for an easy way).

Options

-t
Do only a test run. Files are checked out and changed, but rather than checking the changed files in again, the differences created are recorded.

Examples

UPmove -h
Usage:   UPmove [-t] [-c] [-r] [-u] [-d] [-n] <typ>
  Move files, and change references to them in all aips++
  code files. The script uses the UPfind and UPchange 
  scripts (see there for details).
  <typ>.done and <typ>.error will contain the files successfully
  done or not.
Uses:    <typ>.def, <typ>.sel <typ>.cfnm, <typ>.todo
         <typ>_MVF.found, <typ>_MVF.spat, <typ>_MVF.rmpat
         <typ>_MV.sed, <typ>_MV.rcs, <typ>_MV.found
Creates: <typ>.done, <typ>.error, <typ>.diff
  -t will run a test mode

The next example is the start of a move of some files. The script is first run to get the information (and be able to edit it if necessary).

UPmove -nc spec
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/nfs/aips++/weekly]: /nfs/aips++/daily
Getting info...
Specify file pattern(s) rooted in AIPSROOT/code to find files
Example: trial/implement/Measures/M*.h
File pattern: trial/implement/Wnbt/Spectral*
File pattern: trial/implement/Wnbt/test/tSpec*
File pattern: 
Specify egrep pattern for files to be removed from raw list found.
Example: [/]aipsview[/]
tmplinst files will always be removed
Remove glish files? (y|n) [y]: 
Remove pattern: 
Starting find...
16 files found in spec_MVF.raw
Starting selected removal...
16 files left in spec_MVF.found
16 files in spec.sel to be moved
Specify the sed patterns used to change the name of the moved files
Example: s#trial/#aips/#
Change pattern: s#/Wnbt#/SpectralComponents#
Change pattern: 
Getting info...
Getting info...
Specify the message lines for the RCS log
Example: Moved includes from Quanta to Measures
Text line: Moved the Spectral fitting files from Wnbt to SpectralComponents
Text line: 
Starting find...
16 files found in spec_MV.raw
Starting selected removal...
16 files left in spec_MV.found
Getting info...

The UPlist program can be used to check the files that will be changed (note that you can give the base type name, but that manually editing has to be done on the spec_MV.found):

UPlist spec
Getting info...
16 files found in spec.found
Starting list...
45 lines in spec.list

We now have a dry run with the -t test option:

UPmove -t spec
Getting info...
Need to move files first to new directory (y|n) [n]? y
16 files in spec.sel to be moved
16 files in spec.todo to be changed
amv -src ./trial/implement/Wnbt/Spectral2Element.cc
		./trial/implement/SpectralComponents/Spectral2Element.cc
amv -src ./trial/implement/Wnbt/Spectral2Estimate.cc
		./trial/implement/SpectralComponents/Spectral2Estimate.cc
...
Getting info...
16 files will be changed and checked in/out
Note: in test mode -- no actual file check in after change
./trial/implement/Images/DOimage2.cc started
/aips++/weekly/master/trial/implement/Images/DOimage2.cc,v  -->  DOimage2.cc
revision 15.18
done
...
16 files in spec_MV.done
0 files in spec_MV.error

Checking everything looks ok. We can now transfer all the files to aoc:

UPload spec

and do the actual move (while logged in to AIPS++ master):

UPmove spec
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/aips++/weekly]: /aips++/daily
Need to move files first to new directory (y|n) [n]? y
16 files in spec.sel to be moved
16 files in spec.todo to be changed

The rename command for ax_master is as follows:

15 304 src mv ./trial/implement/Wnbt/Spectral2Element.cc
	./trial/implement/SpectralComponents/Spectral2Element.cc

Continue (y/n) [n]:
 /aips++/weekly/master/install/codemgmt/ax_master,v  --> ax_master 
revision 15.525 (locked)
done
/aips++/weekly/master/install/codemgmt/ax_master,v  <--  ax_master
new revision: 15.526; previous revision: 15.525
done
Renamed master RCS version file
   from /aips++/weekly/master/./trial/implement/Wnbt/Spectral2Element.cc,v
     to
/aips++/weekly/master/./trial/implement/SpectralComponents/Spectral2Element.cc,v
...
./trial/implement/SpectralComponents/SpectralList2.cc started
/aips++/weekly/master/trial/implement/SpectralComponents/SpectralList2.cc,v
 	--> SpectralList2.cc
revision 15.1 (locked)
done
/aips++/weekly/master/trial/implement/SpectralComponents/SpectralList2.cc,v
	 <-- SpectralList2.cc
new revision: 15.2; previous revision: 15.1
done
16 files in spec_MV.done
0 files in spec_MV.error

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPload

Upload the data for the specified type name to the AIPS++ master computer.

Synopsis

UPload [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPload script uploads all relevant information from the given type name identifier to the aoc AIPS++ master (or another machine that can access the master tree with amv).
After transferring the information, login to the master, and run the relevant script(s) (like UPlock, UPmove).

Options

Examples

UPload -h
Usage:   UPload [-c] [-r] [-u] [-d] [-n] <typ>
  Upload the information specified by <typ> to the aips++ 
  master site. This enables to run relevant scripts that
  were tested locally there.
Uses:    <typ>.*
Creates: <typ>.scp

Using the information from the UPmove example, we get:

UPload spec
Getting info...
19 files in spec.scp
Uploading 19 files to wbrouw@aips2.nrao.edu:aips++/code/install/codemgmt ....

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPtmpl

Get a list of all files in all tmplinst directories.

Synopsis

UPtmpl [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPtmpl script lists all the files in all the tmplst directories in the AIPS++ code tree. The result is available in the <type>.tmpinst file.

Options

Examples

UPtmpl -h
Usage:   UPtmpl [-c] [-r] [-u] [-d] [-n] <typ>
  Get all files in all the tmplinst directories.
  The file list will be in <typ>.tmpinst
Uses:    <typ>.def
Creates: <typ>.tmpinst

A real run gives:

UPtmpl xc
Getting info...
Make sure you have a proper mktree built before proceeding...
Specify code tree root to be used [/nfs/aips++/weekly]: 
Getting templated file list...
1729 files found in xc.tmpinst

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPdup

Do a duplicates template test on templates files in the AIPS++ code tree.

Synopsis

UPdup [-s] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPdup script executes the duplicates program on templates files in the AIPS++ system. It checks the repositories in the casa packages against each other; checks the repositories and test templates for the casa packages, and it checks all other packages against the standard casa packages, creating a list with duplicates in the <type>.dup file. This output can be used to check if templates can e.g. safely be moved from some local test or application templates file to one of the standard casa packages. An -s switch is available to run in system mode, which will only indicate duplicates that in general could produce compilation and/or linking problems.

The package handling is done with the aid of in-built lists of 'standard' packages (casapack), packages that should be skipped (skippack) and packages that should each be checked against the standard casa packages (checkpack). The defaults can be overwritten by specifying one or more of these 3 variables in the <type>.pak file. After each run the used variables are saved in the <type>.pak file. A template can easily be derived by running with the -n switch.

Options

-s
Execute in system mode. I.e. only show duplicates that are a real problem.
<type>.pak
If the <type>.pak file is present in the directory from which the UPdup script is run, the checking behaviour can be influenced. Each line in the file contains a series of package names. The name follwing a '//' field gives the name of the variable to be overwritten, the rest are package names. I.e. if <type>.pak contains a line:
  // checkpack atnf trialdisplay
then the duplicates check for the atnf and trialdisplay packages only will be done against the casa base packages.

Examples

UPdup -h
Usage:   UPdup [-s] [-c] [-r] [-u] [-d] [-n] <typ>
  Determine the template duplicates between the package and
  application/test programs. The result will be in <typ>.dup.
Uses:    <typ>.def   <typ>.pak
Creates: <typ>.dup   <type.pak
  -s show only the system template files that can cause
     problems in the aips++ system

  UPdup -s -u
  Assuming <typ> as 'xc'.
  Getting info...
  Starting package display...
  ...
...

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPreident

Do a reident on templates files in the AIPS++ code tree.

Synopsis

UPreident [-a] [-z] [-t] [-c] [-r] [-u] [-d] [-n] <type>

Description

The UPreident script executes the reident program on templates files in the AIPS++ system. By default it runs on the casa and other base library packages. Switches are available to execute it for all packages, and also to re-initialize the numbering. A list of succesful and unsuccessful files handled will be available in <type>.done and <type>.error.

Options

-a
Execute for all packages, rather than only for the casa base ones.
-z
Apply the -z switch, i.e. renumber all templates
-t
Do only a test run. Files are checked out and changed, but rather than checking the changed files in again, the differences created are recorded in <type>.diff.

Examples

UPreident -h
Usage:   UPreident [-a] [-t] [-z] [-c] [-r] [-u] [-d] [-n] <typ>
  Do a reident for all the templates files in the casa basic library
  packages (unless -a switch).
  <typ>.done and <typ>.error will give the templates files
  done and not done.
Uses:    <typ>.def, <typ>.tsel
Creates: <typ>.done, <typ>.error, <typ>/log, <typ>.diff
  -a do all templates files in all packages
  -z use the -z switch on the reident program to renumber 
     all the templates files.
  -t do a dry run, giving the differences in <type>.diff

  UPreident -tu
  Specify type [xc]: 
  Getting info...
  42 templates files found in xc.tsel
  42 files will be changed and checked in/out
  Note: in test mode -- no actual file check in after change
  ./calibration/implement/CalTables/test/templates started
  U templates
  ./calibration/implement/_ReposFiller/templates started
  ...
...

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPsed

Apply a sed pattern to a file. This script is used by the other, main, UP scripts. It may be used stand-alone however.

Synopsis

UPsed [-t <log>] sed <filename in> [<filename out>]

Description

The UPsed script applies a number of sed patterns given in the sed file to an input file, and returns the changed input in the output file. The output file may be the same as the input file (if no output file given, the output file is assumed to be the same as the input file).
If a log file name is given as the first argument (preceded by a -t switch), the differences between the input and output file are added to the log file.

Options

-t <log file>
Add the differences between input and output file to an existing log file

Examples

UPsed
Usage: UPsed [-t <log>] <sed> <filename in> [<filename out>]

Change a cat into a dog:

  cat - > ! c.tmp
  I am a cat today
  cat - >! c.sed
  s#cat#dog#
  UPsed c.sed c.tmp
  cat c.tmp
  I am a dog today

  cat - > ! c.tmp
  I am a cat today
  cat - >! c.sed
  s#cat#dog#
  touch c.log
  UPsed -t c.log c.sed c.tmp
  cat c.log
  1c1
  < I am a cat today
  ---
  > I am a dog today

Author

Original: 2000/09/20 by Wim Brouw, ATNF


UPinfo

Obtain general information for the UP scripts. This script is a support script for the other UP scripts.

Synopsis

source UPinfo

Description

The UPinfo source script is a general aid script for the other, executable UP scripts. It analyses the switches given on the script command lines (and translates them into switches), and makes sure that the general information necessary to run the other scripts is available.

Options

Examples

  UPinfo
  Usage:source UPinfo
  source UPinfo
  script: Undefined variable.

Author

Original: 2000/09/20 by Wim Brouw, ATNF


next up previous contents index
Next: System verification Up: Code development Previous: Template management   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15