This file is indexed.

/usr/share/fish/man/man1/set.1 is in fish-common 2.4.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
.TH "set" 1 "Sun Dec 11 2016" "Version 2.4.0" "fish" \" -*- nroff -*-
.ad l
.nh
.SH NAME
\fBset\fP -- display and change shell variables\&. 

.PP
.SS "Synopsis"
.PP
.nf

\fBset\fP [SCOPE_OPTIONS]
\fBset\fP [OPTIONS] VARIABLE_NAME VALUES\&.\&.\&.
\fBset\fP [OPTIONS] VARIABLE_NAME[INDICES]\&.\&.\&. VALUES\&.\&.\&.
\fBset\fP ( -q | --query ) [SCOPE_OPTIONS] VARIABLE_NAMES\&.\&.\&.
\fBset\fP ( -e | --erase ) [SCOPE_OPTIONS] VARIABLE_NAME
\fBset\fP ( -e | --erase ) [SCOPE_OPTIONS] VARIABLE_NAME[INDICES]\&.\&.\&.
.fi
.PP
.SS "Description"
\fCset\fP manipulates \fCshell variables\fP\&.
.PP
If set is called with no arguments, the names and values of all shell variables are printed\&. If some of the scope or export flags have been given, only the variables matching the specified scope are printed\&.
.PP
With both variable names and values provided, \fCset\fP assigns the variable \fCVARIABLE_NAME\fP the values \fCVALUES\&.\&.\&.\fP\&.
.PP
The following options control variable scope:
.PP
.IP "\(bu" 2
\fC-l\fP or \fC--local\fP forces the specified shell variable to be given a scope that is local to the current block, even if a variable with the given name exists and is non-local
.IP "\(bu" 2
\fC-g\fP or \fC--global\fP causes the specified shell variable to be given a global scope\&. Non-global variables disappear when the block they belong to ends
.IP "\(bu" 2
\fC-U\fP or \fC--universal\fP causes the specified shell variable to be given a universal scope\&. If this option is supplied, the variable will be shared between all the current users fish instances on the current computer, and will be preserved across restarts of the shell\&.
.IP "\(bu" 2
\fC-x\fP or \fC--export\fP causes the specified shell variable to be exported to child processes (making it an 'environment variable')
.IP "\(bu" 2
\fC-u\fP or \fC--unexport\fP causes the specified shell variable to NOT be exported to child processes
.PP
.PP
The following options are available:
.PP
.IP "\(bu" 2
\fC-e\fP or \fC--erase\fP causes the specified shell variable to be erased
.IP "\(bu" 2
\fC-q\fP or \fC--query\fP test if the specified variable names are defined\&. Does not output anything, but the builtins exit status is the number of variables specified that were not defined\&.
.IP "\(bu" 2
\fC-n\fP or \fC--names\fP List only the names of all defined variables, not their value
.IP "\(bu" 2
\fC-L\fP or \fC--long\fP do not abbreviate long values when printing set variables
.PP
.PP
If a variable is set to more than one value, the variable will be an array with the specified elements\&. If a variable is set to zero elements, it will become an array with zero elements\&.
.PP
If the variable name is one or more array elements, such as \fCPATH[1 3 7]\fP, only those array elements specified will be changed\&. When array indices are specified to \fCset\fP, multiple arguments may be used to specify additional indexes, e\&.g\&. \fCset PATH[1] PATH[4] /bin /sbin\fP\&. If you specify a negative index when expanding or assigning to an array variable, the index will be calculated from the end of the array\&. For example, the index -1 means the last index of an array\&.
.PP
The scoping rules when creating or updating a variable are:
.PP
.IP "1." 4
If a variable is explicitly set to either universal, global or local, that setting will be honored\&. If a variable of the same name exists in a different scope, that variable will not be changed\&.
.IP "2." 4
If a variable is not explicitly set to be either universal, global or local, but has been previously defined, the previous variable scope is used\&.
.IP "3." 4
If a variable is not explicitly set to be either universal, global or local and has never before been defined, the variable will be local to the currently executing function\&. Note that this is different from using the \fC-l\fP or \fC--local\fP flag\&. If one of those flags is used, the variable will be local to the most inner currently executing block, while without these the variable will be local to the function\&. If no function is executing, the variable will be global\&.
.PP
.PP
The exporting rules when creating or updating a variable are identical to the scoping rules for variables:
.PP
.IP "1." 4
If a variable is explicitly set to either be exported or not exported, that setting will be honored\&.
.IP "2." 4
If a variable is not explicitly set to be exported or not exported, but has been previously defined, the previous exporting rule for the variable is kept\&.
.IP "3." 4
If a variable is not explicitly set to be either exported or unexported and has never before been defined, the variable will not be exported\&.
.PP
.PP
In query mode, the scope to be examined can be specified\&.
.PP
In erase mode, if variable indices are specified, only the specified slices of the array variable will be erased\&.
.PP
\fCset\fP requires all options to come before any other arguments\&. For example, \fCset flags -l\fP will have the effect of setting the value of the variable \fCflags\fP to '-l', not making the variable local\&.
.PP
In assignment mode, \fCset\fP exits with a non-zero exit status if variable assignments could not be successfully performed\&. If the variable assignments were performed, the exit status is unchanged\&. This allows simultaneous capture of the output and exit status of a subcommand, e\&.g\&. \fCif set output (command)\fP\&. In query mode, the exit status is the number of variables that were not found\&. In erase mode, \fCset\fP exits with a zero exit status in case of success, with a non-zero exit status if the commandline was invalid, if the variable was write-protected or if the variable did not exist\&.
.SS "Example"
.PP
.nf

\fBset\fP -xg
  Prints all global, exported variables\&.
.fi
.PP
.PP
.PP
.nf
\fBset\fP foo hi
  Sets the value of the variable $foo to be 'hi'\&.
.fi
.PP
.PP
.PP
.nf
\fBset\fP -e smurf
  Removes the variable $smurf
.fi
.PP
.PP
.PP
.nf
\fBset\fP PATH[4] ~/bin
  Changes the fourth element of the $PATH array to ~/bin
.fi
.PP
.PP
.PP
.nf
\fBif\fP \fBset\fP python_path (\fBwhich\fP python)
    \fBecho\fP 'Python is at $python_path'
\fBend\fP
  Outputs the path to Python if \fCwhich\fP returns true\&.
.fi
.PP