Product SiteDocumentation Site

14.4.2. Running a script

Once you’ve entered a script, you can run it with the sh command, as shown following, passing the name of your script to the sh command:
$ sh listrpmpkgs
librpm404-devel-4.0.4-8x.27
librpm404-4.0.4-8x.27
rpm404-python-4.0.4-8x.27
rpm-4.1-1.06
rpm-devel-4.1-1.06
gnorpm-0.9-1
rpm-python-4.1-1.06
redhat-rpm-config-8.0-1
rpm-build-4.1-1.06
rpmrebuild-1.0-0
Type the command you have placed in your script at the command line. There should be no difference in the output. For example:
$ rpm -qa | grep rpm
librpm404-devel-4.0.4-8x.27
librpm404-4.0.4-8x.27
rpm404-python-4.0.4-8x.27
rpm-4.1-1.06
rpm-devel-4.1-1.06
gnorpm-0.9-1
rpm-python-4.1-1.06
redhat-rpm-config-8.0-1
rpm-build-4.1-1.06
rpmrebuild-1.0-0