rpm installations should not be user interactive. have the user/admin configure the app once its installed, not during the rpm installation. On Fri, 2007-06-01 at 14:41 +0800, Rayapudi Sandeep-mgb376 wrote: > 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 -- Hiren Patel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This e-mail and its contents are subject to the Telkom SA Limited e-mail legal notice available at http://www.telkom.co.za/TelkomEMailLegalNotice.PDF ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list