RE: Questions on RPM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I had another issue with RPM.

- I need to read some variables from user (with shell command 'read')
and based on that, I will execute some other shell scripts (creating a
database). But when execution comes to 'read' in spec file, it says,
"/var/tmp/rpm-tmp.35565: line 4: [: =: unary operator expected". Please
suggest me. Please find shell scripts and spec file here. 

****spec file*****
%pre
echo "In pre install script"
cd /usr/src/redhat/BUILD/rpmTest-%{version}
read a
if [ $a = "y" ]
then
        sh createDb.sh /home/motorola/CallerId-1.1/
Fi

***** shell script *****
                echo -n "Database server IP: "
                read dbIp
                echo -n "Database name to be created: "
                read dbName
                echo -n "Database user name: "
                read dbUserName
                echo -n "Database password: "
                read dbPwd
                mkdir tempDir
                cp tempOdbc.ini ./tempDir/tempOdbc.ini
                cd tempDir
                sed -e "s/DBIP/$dbIp/g" -e "s/DBNAME/$dbName/g" -e
"s/USR/$dbUserName/g" -e "s/PSSWD/$dbPwd/g" tempOdbc.ini >
tempOdbcTemp.ini
                ./searchReplace LOC $1/tools/odbcLibraries/libmyodbc3.so
                mv tempOdbcTemp.ini ../
                rm -f searchReplace
                cd ..
                rmdir tempDir
                export ODBCINI=$PWD/tempOdbcTemp.ini
                echo "drop database $dbName" | isql -v temp $dbUserName
$dbPwd -w > /dev/null
                echo "CREATE DATABASE $dbName" | isql -v temp
$dbUserName $dbPwd -w > /dev/null

######## here I am executing ".sql" file ############

                cat ldb.sql | isql -v ldb $dbUserName $dbPwd -w
                #cat triggers.sql | isql -v ldb $dbUserName $dbPwd -w
                rm -f $PWD/tempOdbcTemp.ini
                exit



Thanks a lot for your support

Thnx,
-Sandeep

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux