![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| #!/bin/sh script fails at StringA | tr "[x]" "[y]" | by_tg | UNIX for Dummies Questions & Answers | 3 | 02-22-2008 12:17 PM |
| Put fails during FTP | prakash.kudreka | UNIX for Advanced & Expert Users | 2 | 11-15-2007 05:14 AM |
| SCP fails sometimes | vipinc | AIX | 10 | 07-18-2007 03:38 AM |
| Shell Script fails with "can't connect to client" | sseenu79 | HP-UX | 2 | 12-20-2006 10:47 AM |
| System Fails | nikk | UNIX for Advanced & Expert Users | 2 | 07-07-2004 10:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Script fails
Hi,
I am trying to install a package on solaris and one of the packaging scripts fail unexpectedly. There is a script called "checkinstall" which checks for the /opt space and aborts the installation if /opt is less than 100MB. In my case, even if /opt has enoguh space, the script fails. This is my script REQUIRED_SAPCE="100000" AVAILABLE_SPACE=`df -k /opt | grep -v "avail" | awk '{print $4}'` if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ] then echo "Space available in /opt is ${AVAILABLE_SPACE}KB. ${REQUIRED_SPACE}KB required" exit 1 fi The baffling thing here is, we get an error message like this and the installation gets aborted. Space available in /opt is 450000KB. 100000KB required. So, obviously /opt has enough space. Then why this gets into the if loop unnecessarily. What could be the problem? Any ideas?? This works fine on our test machines and the issue is happening at one of the customer's machines. Thanks in advance, JStone. |
|
||||
|
Hi, Thanks for the reply. That was a typo by mistake. I iterate that I have installed the package successfully in our test enviroment so many times, I am just trying to figure out the reason for the failure on the customer's machine. Could that be something related to their machine settings?? By the way, what is the shell used during an install?
|
|
|||||
|
The shell used during an install will usually depend on the shebang that is present in the installation script. Try the following Code:
set -x ./run your script set +x You should be able to see the commmands being carried out. That should help you. Unless you get access to the customer's box or ask the customer to run the above, I dont think there is a way to debug this. |
|
|||||
|
With AIX, the df command output shows the free space in the field 3 and the field header is'nt 'avail' but 'Free'. Code:
$ df -k /opt Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 163840 32724 81% 1847 3% / The -P option (Displays information on the file system in POSIX portable format) gives output compatible with your script : Code:
$ df -kP /opt Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hd4 163840 131116 32724 81% / Jean-Pierre. Last edited by aigles; 08-09-2006 at 05:20 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|