Linuxfun Part 2-1-37
Linuxfun Part 2-1-37
Linuxfun Part 2-1-37
Paul Cobbaut
Table of Contents
I. introduction to Linux ............................................................................................................................. ...... 1
Part II. shell expansion ............................................................................................................................................ 5
Chapter 1. commands and arguments ....................................................................................................... 6
1.1. arguments ...................................................................................................................................... 7
1.2. white space removal ...................................................................................................................... 7
1.3. single quotes .................................................................................................................................. 7
1.4. double quotes................................................................................................................................. 7
1.5. echo and quotes ............................................................................................................................. 8
1.6. commands ..................................................................................................................................... 8
1.7. aliases ............................................................................................................................................ 9
1.8. displaying shell expansion ........................................................................................................... 10
1.9. practice: commands and arguments ............................................................................................. 10
Chapter 2. control operators ..................................................................................................................... 12
2.1. ; semicolon .................................................................................................................................. 13
2.2. & ampersand ............................................................................................................................... 13
2.3. $? dollar question mark ............................................................................................................... 13
2.4. && double ampersand................................................................................................................. 13
2.5. || double vertical bar .................................................................................................................... 14
2.6. combining && and || ................................................................................................................... 14
2.7. # pound sign ................................................................................................................................ 14
2.8. \ escaping special characters ........................................................................................................ 15
2.9. practice: control operators ........................................................................................................... 15
Chapter 3. shell variables .......................................................................................................................... 17
3.1. $ dollar sign ................................................................................................................................. 18
3.2. case sensitive ............................................................................................................................... 18
3.3. creating variables......................................................................................................................... 18
3.4. quotes .......................................................................................................................................... 18
3.5. set ................................................................................................................................................ 19
3.6. unset ............................................................................................................................................ 19
3.7. $PS1 ............................................................................................................................................ 19
3.8. $PATH ......................................................................................................................................... 21
3.9. env ............................................................................................................................................... 21
3.10. export......................................................................................................................................... 22
3.11. delineate variables ..................................................................................................................... 22
3.12. unbound variables ..................................................................................................................... 22
3.13. practice: shell variables ............................................................................................................. 23
Chapter 4. shell embedding and options .................................................................................................. 24
4.1. shell embedding........................................................................................................................... 25
4.2. shell options ................................................................................................................................ 26
4.3. practice: shell embedding ............................................................................................................ 26
Chapter 5. file globbing ............................................................................................................................. 28
5.1. * asterisk...................................................................................................................................... 29
5.2. ? question mark ........................................................................................................................... 29
5.3. [] square brackets ........................................................................................................................ 29
5.4. a-z and 0-9 ranges ....................................................................................................................... 30
5.5. $LANG and square brackets ....................................................................................................... 30
5.6. preventing file globbing .............................................................................................................. 31
5.7. practice: shell globbing ............................................................................................................... 32
Chapter 6. shell history.............................................................................................................................. 33
6.1. repeating the last command ......................................................................................................... 34
6.2. repeating other commands ........................................................................................................... 34
6.3. history .......................................................................................................................................... 34
6.4. !n ................................................................................................................................................. 34
6.5. Ctrl-r ............................................................................................................................................ 35
6.6. $HISTSIZE ................................................................................................................................. 35
6.7. $HISTFILE ................................................................................................................................. 35
6.8. $HISTFILESIZE ......................................................................................................................... 35
6.9. prevent recording a command ..................................................................................................... 36
6.10. (optional)regular expressions .................................................................................................... 36
6.12. practice: shell history................................................................................................................. 36
16.13. solution: shell history .............................................................................................................. 37
Part III. pipes and commands ................................................................................................................................ 38
Chapter 1. I/O redirection ......................................................................................................................... 39
1.1. stdin, stdout, and stderr................................................................................................................ 40
1.2. output redirection ........................................................................................................................ 40
1.3. error redirection ........................................................................................................................... 42
1.4. output redirection and pipes ........................................................................................................ 43
1.5. joining stdout and stderr .............................................................................................................. 43
1.6. input redirection .......................................................................................................................... 43
1.7. confusing redirection ................................................................................................................... 44
1.8. quick file clear ............................................................................................................................. 45
1.9. practice: input/output redirection ................................................................................................ 46
1.10. solution: input/output redirection .............................................................................................. 47
Chapter 2. filters ........................................................................................................................................ 48
2.1. cat ................................................................................................................................................ 49
2.2. tee ................................................................................................................................................ 49
2.3. grep.............................................................................................................................................. 49
2.4. cut ................................................................................................................................................ 50
2.5. tr .................................................................................................................................................. 51
2.6. wc ................................................................................................................................................ 52
2.7. sort ............................................................................................................................................... 52
2.8. uniq.............................................................................................................................................. 53
2.9. comm ........................................................................................................................................... 54
2.10. od ............................................................................................................................................... 54
2.11. sed.............................................................................................................................................. 56
2.12. pipe examples ............................................................................................................................ 56
2.13. practice: filters ........................................................................................................................... 57
Chapter 3. basic Unix tools ....................................................................................................................... 58
3.1. find .............................................................................................................................................. 59
3.2. locate ........................................................................................................................................... 59
3.3. date .............................................................................................................................................. 60
3.4. cal ................................................................................................................................................ 60
3.5. sleep............................................................................................................................................. 61
3.6. time.............................................................................................................................................. 61
3.7. gzip - gunzip ................................................................................................................................ 62
3.8. zcat - zmore ................................................................................................................................. 62
3.9. bzip2 - bunzip2 ............................................................................................................................ 62
3.10. bzcat - bzmore ........................................................................................................................... 62
3.11. practice: basic Unix tools .......................................................................................................... 63
Chapter 4. regular expressions ................................................................................................................. 64
4.1. regex versions .............................................................................................................................. 65
4.2. grep.............................................................................................................................................. 66
4.3. rename ......................................................................................................................................... 70
4.4. sed ............................................................................................................................................... 72
4.5. bash history ................................................................................................................................. 75
iii
Linux Fundamentals
iv
Part II. shell expansion
Chapter 1. commands and arguments
This chapter introduces you to shell expansion by taking a close look at commands and
arguments. Knowing shell expansion is important because many commands on your Linux
system are processed and most likely changed by the shell before they are executed.
The command line interface or shell used on most Linux systems is called bash, which stands
for Bourne again shell.
This chapter frequently uses the echo command to demonstrate shell features. The echo
command is very simple: it echoes the input that it receives.
paul@laika:~$ echo Burtonville
Burtonville
paul@laika:~$ echo Smurfs are blue
Smurfs are blue
6
commands and arguments
1.1. arguments
One of the primary features of a shell is to perform a command line scan. When you enter
a command at the shell's command prompt and press the enter key, then the shell will start
scanning that line, cutting it up in arguments. While scanning the line, the shell may make
many changes to the arguments you typed.
This process is called shell expansion. When the shell has finished scanning and modifying
that line, then it will be executed.
This explains why the following four different command lines are the same after shell
expansion.
[paul@RHELv4u3 ~]$ echo Hello World
Hello World
[paul@RHELv4u3 ~]$ echo Hello World
Hello World
[paul@RHELv4u3 ~]$ echo Hello World
Hello World
[paul@RHELv4u3 ~]$ echo Hello World
Hello World
The echo command will display each argument it receives from the shell. The echo
command will also add a new white space between the arguments it received.
7
commands and arguments
Later in this book, when discussing variables we will see important differences between
single and double quotes.
1.6. commands
1.6.1. external or builtin commands ?
Not all commands are external to the shell, some are builtin. External commands are
programs that have their own binary and reside somewhere in the file system. Many external
commands are located in /bin or /sbin. Builtin commands are an integral part of the shell
program itself.
1.6.2. type
To find out whether a command given to the shell will be executed as an external command
or as a builtin command, use the type command.
paul@laika:~$ type cd
cd is a shell builtin
paul@laika:~$ type cat
cat is /bin/cat
As you can see, the cd command is builtin and the cat command is external. You can
also use this command to show you whether the command is aliased or not.
paul@laika:~$ type ls
8
commands and arguments
1.6.4. which
The which command will search for binaries in the $PATH environment variable (variables
will be explained later). In the screenshot below, it is determined that cd is builtin, and ls,
cp, rm, mv, mkdir, pwd, and which are external commands.
[root@RHEL4b ~]# which cp ls cd mkdir pwd
/bin/cp
/bin/ls /usr/bin/which: no cd in (/usr/kerberos/sbin:/usr/kerberos/bin:...
/bin/mkdir
/bin/pwd
1.7. aliases
1.7.1. create an alias
The shell allows you to create aliases. Aliases are often used to create an easier to remember
name for an existing command or to easily supply parameters.
[paul@RHELv4u3 ~]$ cat count.txt
one two three
paul@laika:~$
9
commands and arguments
1.7.5. unalias
You can undo an alias with the unalias command.
[paul@RHEL4b ~]$ which rm
/bin/rm
[paul@RHEL4b ~]$ alias rm='rm -i'
[paul@RHEL4b ~]$ which rm
alias rm='rm -i' /bin/rm
[paul@RHEL4b ~]$ unalias rm
[paul@RHEL4b ~]$ which rm
/bin/rm
[paul@RHEL4b ~]$
10
commands and arguments
4. Read the man page of rm, make sure you understand the -i option of rm. Create and
remove a file to test the -i option.
5. Execute: alias rm='rm -i' . Test your alias with a test file. Does this work as expected ?
12. What is the location of the cat and the passwd commands ?
/bin/echo
echo -n Hello
(optional)16. Complete the following command (do not use spaces) to display exactly the
following output:
4+4 =8
10+14 =24
18. Use one echo command to display three words on three lines.
11
Chapter 2. control operators
In this chapter we put more than one command on the command line using control
operators. We also briefly discuss related parameters ($?) and similar special characters(&).
12
control operators
2.1. ; semicolon
You can put two or more commands on the same line separated by a semicolon ; . The shell
will scan the line until it reaches the semicolon. All the arguments before this semicolon
will be considered a separate command from all the arguments after the semicolon. Both
series will be executed sequentially with the shell waiting for each command to finish before
starting the next one.
[paul@RHELv4u3 ~]$ echo Hello
Hello
[paul@RHELv4u3 ~]$ echo World
World
[paul@RHELv4u3 ~]$ echo Hello ; echo World
Hello
World
[paul@RHELv4u3 ~]$
13
control operators
Another example of the same logical AND principle. This example starts with a working cd
followed by ls, then a non-working cd which is not followed by ls.
[paul@RHELv4u3 ~]$ cd gen && ls
file1 file3 File55 fileab FileAB fileabc file2 File4
FileA Fileab fileab2
[paul@RHELv4u3 gen]$ cd gen && ls
-bash: cd: gen: No such file or directory
14
control operators
paul@debian4:~/test$ ls # is it empty ?
paul@debian4:~/test$
hello ; world
hello world
15
control operators
6. Echo it worked when touch test42 works, and echo it failed when the touch failed. All
on one command line as a normal user (not root). Test this line in your home directory
and in /bin/ .
9. Write a command line that executes rm file55. Your command line should print 'success'
if file55 is removed, and print 'failed' if there was a problem.
(optional)10. Use echo to display "Hello World with strange' characters \ * [ } ~ \ \ ."
(including all quotes)
16
Chapter 3. shell variables
In this chapter we learn to manage environment variables in the shell. These variables are
often needed by applications.
17
shell variables
These are some examples using $HOSTNAME, $USER, $UID, $SHELL, and $HOME.
[paul@RHELv4u3 ~]$ echo This is the $SHELL shell
This is the /bin/bash shell
[paul@RHELv4u3 ~]$ echo This is $SHELL on computer $HOSTNAME
This is /bin/bash on computer RHELv4u3.localdomain
[paul@RHELv4u3 ~]$ echo The userid of $USER is $UID
The userid of paul is 500
[paul@RHELv4u3 ~]$ echo My homedir is $HOME
My homedir is /home/paul
3.4. quotes
Notice that double quotes still allow the parsing of variables, whereas single quotes prevent
this.
[paul@RHELv4u3 ~]$ MyVar=555
[paul@RHELv4u3 ~]$ echo $MyVar
555
[paul@RHELv4u3 ~]$ echo "$MyVar"
555
[paul@RHELv4u3 ~]$ echo '$MyVar'
$MyVar
The bash shell will replace variables with their value in double quoted lines, but not in single
quoted lines.
18
shell variables
paul@laika:~$ city=Burtonville
paul@laika:~$ echo "We are in $city today."
We are in Burtonville today.
3.5. set
You can use the set command to display a list of environment variables. On Ubuntu and
Debian systems, the set command will also list shell functions after the shell variables. Use
set | more to see the variables then.
3.6. unset
Use the unset command to remove a variable from your shell environment.
[paul@RHEL4b ~]$ MyVar=8472
[paul@RHEL4b ~]$ echo $MyVar
8472
[paul@RHEL4b ~]$ unset MyVar
[paul@RHEL4b ~]$ echo $MyVar
[paul@RHEL4b ~]$
3.7. $PS1
The $PS1 variable determines your shell prompt. You can use backslash escaped special
characters like \u for the username or \w for the working directory. The bash manual has a
complete reference.
PS1='\u@\h$ '
paul@deb503$ paul@deb503$
PS1='\u@\h:\W$'
paul@deb503:~$
To avoid unrecoverable mistakes, you can set normal user prompts to green and the root
prompt to red. Add the following to your .bashrc for a green user prompt:
# color prompt by paul
RED='\[\033[01;31m\]'
WHITE='\[\033[01;00m\]'
GREEN='\[\033[01;32m\]' BLUE='\[\033[01;34m\]'
19
shell variables
export
PS1="${debian_chroot:+($debian_chroot)}$GREEN\u$WHITE@$BLUE\h$WHITE\w\$ "
20
shell variables
3.8. $PATH
The $PATH variable is determines where the shell is looking for commands to execute
(unless the command is builtin or aliased). This variable contains a list of directories,
separated by colons.
[[paul@RHEL4b ~]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:
The shell will not look in the current directory for commands to execute! (Looking for
executables in the current directory provided an easy way to hack PC-DOS computers). If
you want the shell to look in the current directory, then add a . at the end of your $PATH.
[paul@RHEL4b ~]$ PATH=$PATH:.
[paul@RHEL4b ~]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:.
[paul@RHEL4b ~]$
Your path might be different when using su instead of su - because the latter will take on
the environment of the target user. The root user typically has /sbin directories added to the
$PATH variable.
[paul@RHEL3 ~]$ su
Password:
[root@RHEL3 paul]# echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
[root@RHEL3 paul]# exit
[paul@RHEL3 ~]$ su Password:
[root@RHEL3 ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:
[root@RHEL3 ~]#
3.9. env
The env command without options will display a list of exported variables. The difference
with set with options is that set lists all variables, including those not exported to child
shells.
But env can also be used to start a clean shell (a shell without any inherited environment).
The env -i command clears the environment for the subshell.
Notice in this screenshot that bash will set the $SHELL variable on startup.
[paul@RHEL4b ~]$ bash -c 'echo $SHELL $HOME $USER'
/bin/bash /home/paul paul
[paul@RHEL4b ~]$ env -i bash -c 'echo $SHELL $HOME $USER'
/bin/bash
[paul@RHEL4b ~]$
You can use the env command to set the $LANG, or any other, variable for just one instance
of bash with one command. The example below uses this to show the influence of the
$LANG variable on file globbing (see the chapter on file globbing).
[paul@RHEL4b test]$ env LANG=C bash -c 'ls File[a-z]'
21
shell variables
Filea Fileb
[paul@RHEL4b test]$ env LANG=en_US.UTF-8 bash -c 'ls File[a-z]'
Filea FileA Fileb FileB
[paul@RHEL4b test]$
3.10. export
You can export shell variables to other shells with the export command. This will export
the variable to child shells.
[paul@RHEL4b ~]$ var3=three
[paul@RHEL4b ~]$ var4=four
[paul@RHEL4b ~]$ export var4
But it will not export to the parent shell (previous screenshot continued).
[paul@RHEL4b ~]$ export var5=five
[paul@RHEL4b ~]$ echo $var3 $var4 $var5 four five
[paul@RHEL4b ~]$ exit exit
[paul@RHEL4b ~]$ echo $var3 $var4 $var5 three four
[paul@RHEL4b ~]$
[paul@RHELv4u3 gen]$
22
shell variables
There is, however, the nounset shell option that you can use to generate an error when a
variable does not exist.
paul@laika:~$ set -u
paul@laika:~$ set +u
paul@laika:~$
In the bash shell set -u is identical to set -o nounset and likewise set +u is identical to set
+o nounset.
9. Create a variable, give it the value 'Dumb', create another variable with value 'do'.
Useecho and the two variables to echo Dumbledore.
10. Find the list of backslash escaped characters in the manual of bash. Add the time to
your PS1 prompt.
23
Chapter 4. shell embedding and
options
This chapter takes a brief look at child shells, embedded shells and shell options.
24
shell embedding and options
[paul@RHELv4u3 gen]$
You can embed a shell in an embedded shell, this is called nested embedding of shells.
4.1.1. backticks
Single embedding can be useful to avoid changing your current directory. The screenshot
below uses backticks instead of dollar-bracket to embed.
[paul@RHELv4u3 ~]$ echo `cd /etc; ls -d * | grep pass`
passwd passwd- passwd.OLD
[paul@RHELv4u3 ~]$
You can only use the $() notation to nest embedded shells, backticks cannot do this.
25
shell embedding and options
[paul@RHEL4b ~]$
To list all the set options for your shell, use echo $-. The noclobber (or -C) option will be
explained later in this book (in the I/O redirection chapter).
[paul@RHEL4b ~]$ echo $himBH
[paul@RHEL4b ~]$ set -C ; set -u
[paul@RHEL4b ~]$ echo $himuBCH
[paul@RHEL4b ~]$ set +C ; set +u
[paul@RHEL4b ~]$ echo $himBH
[paul@RHEL4b ~]$
When typing set without options, you get a list of all variables without function when the
shell is on posix mode. You can set bash in posix mode typing set -o posix.
2. Activate nounset in your shell. Test that it shows an error message when using
nonexisting variables.
3. Deactivate nounset.
The echo command is only needed to show the result of the ls command. Omitting will
result in the shell trying to execute the first file as a command.
5. Create the variable embvar in an embedded shell and echo it. Does the variable exist
inyour current shell now ?
26
shell embedding and options
(optional)7. Given the following screenshot, add exactly four characters to that command
line so that the total output is FirstMiddleLast.
[paul@RHEL4b ~]$ echo First; echo Middle; echo Last
8. Display a long listing (ls -l) of the passwd command using the which command inside
an embedded shell.
(optional)7. Given the following screenshot, add exactly four characters to that command
line so that the total output is FirstMiddleLast.
[paul@RHEL4b ~]$ echo First; echo Middle; echo Last
8. Display a long listing (ls -l) of the passwd command using the which command inside
an embedded shell.
ls -l $(which passwd)
27
Chapter 5. file globbing
The shell is also responsible for file globbing (or dynamic filename generation). This
chapter will explain file globbing.
28
file globbing
5.1. * asterisk
The asterisk * is interpreted by the shell as a sign to generate filenames, matching the
asterisk to any combination of characters (even none). When no path is given, the shell will
use filenames in the current directory. See the man page of glob(7) for more information.
(This is part of LPI topic 1.103.3.)
[paul@RHELv4u3 gen]$ ls file1 file2 file3 File4 File55 FileA fileab
Fileab FileAB fileabc [paul@RHELv4u3 gen]$ ls File*
File4 File55 FileA Fileab FileAB
[paul@RHELv4u3 gen]$ ls file* file1
file2 file3 fileab fileabc
[paul@RHELv4u3 gen]$ ls *ile55
File55
[paul@RHELv4u3 gen]$ ls F*ile55
File55
[paul@RHELv4u3 gen]$ ls F*55
File55
[paul@RHELv4u3 gen]$
You can also exclude characters from a list between square brackets with the exclamation
mark !. And you are allowed to make combinations of these wild cards.
29
file globbing
[paul@RHELv4u3 gen]$ ls
file1 file2 file3 File4 File55 FileA fileab Fileab FileAB fileabc
[paul@RHELv4u3 gen]$ ls file[a5][!Z]
fileab
[paul@RHELv4u3 gen]$ ls file[!5]*
file1 file2 file3 fileab fileabc
[paul@RHELv4u3 gen]$ ls file[!5]? fileab
[paul@RHELv4u3 gen]$
[paul@RHELv4u3 gen]$
If $LC_ALL is set, then this will also need to be reset to prevent file globbing.
30
file globbing
Globbing can be prevented using quotes or by escaping the special characters, as shown in
this screenshot.
paul@ubu1010:~/test42$ echo *
file33 file42
paul@ubu1010:~/test42$ echo \*
*
paul@ubu1010:~/test42$ echo '*'
*
paul@ubu1010:~/test42$ echo "*"
*
31
file globbing
5. List (with ls) all files starting with file and ending in a number.
6. List (with ls) all files starting with file and ending with a letter
7. List (with ls) all files starting with File and having a digit as fifth character.
8. List (with ls) all files starting with File and having a digit as fifth character and
nothingelse.
9. List (with ls) all files starting with a letter and ending in a number.
10. List (with ls) all files that have exactly five characters.
11. List (with ls) all files that start with f or F and end with 3 or A.
12. List (with ls) all files that start with f have i or R as second character and end in a number.
13. List all files that do not start with the letter F.
16. You receive information that one of your servers was cracked, the cracker
probablyreplaced the ls command. You know that the echo command is safe to use. Can
echo replace ls ? How can you list the files in the current directory with echo ?
32
Chapter 6. shell history
The shell makes it easy for us to repeat commands, this chapter explains how.
33
shell history
paul@debian5:~/test42$
touch file42
paul@debian5:~/test42$
6.3. history
To see older commands, use history to display the shell command history (or use history n
to see the last n commands).
paul@debian5:~/test$ history 10
38 mkdir test
39 cd test
40 touch file1
41 echo hello > file2
42 echo It is very cold today >
winter.txt
43 ls
44 ls -l
45 cp winter.txt summer.txt
46 ls -l
47 history 10
6.4. !n
When typing ! followed by the number preceding the command you want repeated, then the
shell will echo the command and execute it.
paul@debian5:~/test$ !43
ls
34
shell history
6.5. Ctrl-r
Another option is to use ctrl-r to search in the history. In the screenshot below i only typed
ctrl-r followed by four characters apti and it finds the last command containing these four
consecutive characters.
paul@debian5:~$ (reverse-i-search)`apti':
6.6. $HISTSIZE
The $HISTSIZE variable determines the number of commands that will be remembered in
your current environment. Most distributions default this variable to 500 or 1000.
paul@debian5:~$ echo $HISTSIZE
500
6.7. $HISTFILE
The $HISTFILE variable points to the file that contains your history. The bash shell defaults
this value to ~/.bash_history.
paul@debian5:~$ echo $HISTFILE
/home/paul/.bash_history
A session history is saved to this file when you exit the session!
Closing a gnome-terminal with the mouse, or typing reboot as root will NOT save your
terminal's history.
6.8. $HISTFILESIZE
The number of commands kept in your history file can be set using $HISTFILESIZE.
paul@debian5:~$ echo $HISTFILESIZE
15000
35
shell history
2. Repeat the previous command using only two characters (there are two solutions!)
4. Issue the long echo from question 1 again, using the line numbers you received from the
command in question 3.
5. How many commands can be kept in memory for your current shell session ?
7. How many commands can be written to the history file when exiting your current shell
session ?
8. Make sure your current bash shell remembers the next 5000 commands you type.
9. Open more than one console (by press Ctrl-shift-t in gnome-terminal, or by opening
anextra putty.exe in MS Windows) with the same user account. When is command history
written to the history file ?
36
shell history
2. Repeat the previous command using only two characters (there are two solutions!)
!!
OR
!e
4. Issue the long echo from question 1 again, using the line numbers you received from the
command in question 3.
paul@ubu1010:~$ !55
echo The answer to the meaning of life, the universe and everything is 42
The answer to the meaning of life, the universe and everything is 42
5. How many commands can be kept in memory for your current shell session ?
echo $HISTSIZE
7. How many commands can be written to the history file when exiting your current shell
session ?
echo $HISTFILESIZE
8. Make sure your current bash shell remembers the next 5000 commands you type.
HISTSIZE=5000
9. Open more than one console (by press Ctrl-shift-t in gnome-terminal, or by opening
anextra putty.exe in MS Windows) with the same user account. When is command history
written to the history file ?
when you type exit
37