<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body ><div>Jeff Haemer taught me to start all my scripts with this:</div><div>#!/bin/bash -eu</div><div>Or this:</div><div>#!/bin/bash -eux</div><div><br></div><div>e means exit on any unhandled error</div><div><br></div><div>u means exit on the use of any unset variable</div><div><br></div><div>x means to echo every statement as it's processed</div><div><br></div><div>I use eu always, and x when I'm having problems.</div><div><br></div><div><div style="font-size:9px;color:#575757">Sent from my Verizon Wireless 4G LTE smartphone</div></div><div></div><br><br>-------- Original message --------<br>From: Mike Bean &lt;beandaemon@gmail.com&gt; <br>Date: 03/06/2015  1:54 PM  (GMT-07:00) <br>To: CLUE's mailing list &lt;clue@cluedenver.org&gt; <br>Subject: [clue] seeking debugging advice <br><br><div dir="ltr">OK - I've been staring at this for a while, I'm just not seeing it.&nbsp; Anyone have any suggestions as to why<div><br></div><div><div>#setupScript.sh</div><div>#assumes RHEL 64 bit</div><div>#install RPMs</div><div>yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts" "Graphical Administration Tools" "Internet Browser" "General Purpose Desktop" "Graphics Creation Tools" "Legacy X Window System compatibility"</div><div>#set default boot to rl5</div><div>sed -i 's/id:3:initdefault:/id:5:initdefault:/g' /etc/inittab</div><div>echo "inserting a test line"</div><div>/bin/rpm -ivh /root/packages/epel-release-6-8.noarch.rpm</div><div>/bin/rpm -i /root/packages/fahcontrol-7.4.4-1.noarch.rpm</div><div>/bin/rpm -i /root/packages/fahviewer-7.4.4-1.x86_64.rpm</div><div>/bin/rpm -i /root/packages/fahclient-7.4.4-1.x86_64.rpm</div><div>/bin/rpm -i /root/packages/nomachine_4.4.12_11_x86_64.rpm</div><div>#configures nomachine</div><div>cp /usr/NX/etc/server.cfg /usr/NX/etc/server.cfg.backup2</div><div>sed -i 's/EnablePasswordDB = "0"/EnablePasswordDB = "1"/g' /usr/NX/etc/server.cfg</div><div>service sshd restart</div><div>/usr/NX/bin/nxserver --restart</div><div>#adds myuser</div><div>useradd -m -d /home/mbean -s /bin/bash mbean</div><div>passwd mbean</div><div>/usr/NX/bin/nxserver --useradd mbean</div><div>#copies sshKeys</div><div>cp -pr /root/.ssh/authorized_keys /home/mbean/.ssh/authorized_keys</div><div>chown -r mbean /home/mbean/.ssh</div><div>chgrp -r mbean /home/mbean/.ssh</div><div>#deletes the default user</div><div>userdel ec2-user</div><div>rm -rf /home/ec2-user</div></div><div><br></div><div>Produces:&nbsp;</div><div><br></div><div><div>Package xorg-x11-fonts-Type1-7.2-9.1.el6.noarch already installed and latest version</div><div>Package xorg-x11-fonts-misc-7.2-9.1.el6.noarch already installed and latest version</div><div>Package xorg-x11-fonts-100dpi-7.2-9.1.el6.noarch already installed and latest version</div><div>Package xorg-x11-fonts-ISO8859-1-100dpi-7.2-9.1.el6.noarch already installed and latest version</div><div>Warning: Group legacy-x does not have any packages.</div><div>No packages in any requested group available to install or update</div><div>: No such file or directoryb</div><div>inserting a test line</div><div>&nbsp;failed: No such file or directory-release-6-8.noarch.rpm</div><div>&nbsp;failed: No such file or directoryontrol-7.4.4-1.noarch.rpm</div><div>&nbsp;failed: No such file or directoryiewer-7.4.4-1.x86_64.rpm</div><div>&nbsp;failed: No such file or directorylient-7.4.4-1.x86_64.rpm</div><div>&nbsp;failed: No such file or directorychine_4.4.12_11_x86_64.rpm</div><div>: No such file or directory/server.cfg</div></div><div><br></div><div>What's really confusing me is that I literally went through and executed the commands one at a time by hand without any errors. &nbsp; Only thing I can think of is maybe there's some funky text expansion or special character in userspace that I'm missing.</div><div><br></div><div>Here's the contents of /root/packages:</div><div><br></div><div><div>drwxr-xr-x. 3 root root &nbsp; &nbsp; 4096 Mar &nbsp;6 15:46 .</div><div>dr-xr-x---. 6 root root &nbsp; &nbsp; 4096 Mar &nbsp;6 15:18 ..</div><div>-rw-r--r--. 1 root root &nbsp; &nbsp; 1308 Mar &nbsp;6 15:29 1</div><div>-rw-r--r--. 1 root root &nbsp; &nbsp;14540 Mar &nbsp;5 15:55 epel-release-6-8.noarch.rpm</div><div>-rw-r--r--. 1 root root &nbsp;4594767 Mar &nbsp;5 15:56 fahclient-7.4.4-1.x86_64.rpm</div><div>-rw-r--r--. 1 root root &nbsp; 234381 Mar &nbsp;5 15:56 fahcontrol-7.4.4-1.noarch.rpm</div><div>-rw-r--r--. 1 root root &nbsp;4932300 Mar &nbsp;5 15:56 fahviewer-7.4.4-1.x86_64.rpm</div><div>drwx------. 2 root root &nbsp; &nbsp;16384 Mar &nbsp;6 13:54 lost+found</div><div>-rw-r--r--. 1 root root 32634161 Mar &nbsp;3 14:02 nomachine_4.4.12_11_x86_64.rpm</div><div>-rwxr--r--. 1 root root &nbsp; &nbsp; 1230 Mar &nbsp;6 15:46 setupScript.sh</div><div>-rwxr--r--. 1 root root &nbsp; &nbsp; &nbsp;248 Mar &nbsp;6 15:38 testscript.sh</div><div>[root@ip-172-31-43-35 packages]# pwd</div><div>/root/packages</div></div><div><br></div><div>advice is appreciated</div><div><br></div><div>Mike B</div></div>
</body>