- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Problems on execute script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 09:28 PM
тАО11-28-2005 09:28 PM
I want to execute the following script but since system was rebooted I can't:
#!/sbin/sh -x
fs=vgora/lvol5
max=70
min=30
volum="$(bdf |grep $fs | tr -s ' ' '$' | cut -f5 -d $ | cut -c1-2)"
if [ "$volum" -ge "$max" ]
then
remsh omniback /opt/omni/bin/omnib -oracle8_list Oracle_Archivers_Paris_Total 2>> /DES/oracle/arch/scripts/sortida
>> /DES/oracle/arch/scripts/sortida
fi
if [ "$volum" -ge "$min" ] && [ "$volum" -lt "$max" ]
then
remsh omniback /opt/omni/bin/omnib -oracle8_list Oracle_Archivers_Paris 2>> /DES/oracle/arch/scripts/sortida
>> /DES/oracle/arch/scripts/sortida
fi
Output I got when I launch script is as follows:
+ fs=vgora/lvol5
+ max=70
+ min=30
+ + bdf
+ grep vgora/lvol5
+ tr -s $
+ cut -f5 -d $
+ cut -c1-2
volum=0%
+ [ 0% -ge 70 ]
/DES/oracle/arch/scripts/volum.sh[12]: 0%: Expression is not complete; more tokens expected.
+ [ 0% -ge 30 ]
/DES/oracle/arch/scripts/volum.sh[17]: 0%: Expression is not complete; more tokens expected.
Should I modify any kernel parameter?
Thanks in advance for your help!
Carles
PS: System is HP-UX B.11.11 U
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 09:36 PM
тАО11-28-2005 09:36 PM
Re: Problems on execute script
Why tr and all that??
volum=$(bdf / |grep -v '[F]ilesystem'|awk '{print $5}'|awk -F "%" '{print $1}')
Then your comparisions.
Check your assignment and the one I am giving here. You need to eliminate % from var assignment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 09:39 PM
тАО11-28-2005 09:39 PM
Re: Problems on execute script
maybe it's a stupid question but
are you sure that file system is mounted
(fs=vgora/lvol5) ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 09:59 PM
тАО11-28-2005 09:59 PM
Re: Problems on execute script
1st at all, volume and filesystem is mounted.
I'm going to delete % from assignement and execute script.
I know script didn't work fine as volum assignement is wrong, but why does script stop to run since reboot?
Regards,
Carles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 10:03 PM
тАО11-28-2005 10:03 PM
Re: Problems on execute script
volum=$(bdf | grep $fs | awk '{ split($5,a,"%");print a[1]; }')
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 11:11 PM
тАО11-28-2005 11:11 PM
Re: Problems on execute script
Script works fine now. Thanks a lot!
BTW, is there any way to avoid output messages?
Thanks again,
Carles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2005 11:17 PM
тАО11-28-2005 11:17 PM
SolutionThe use of the '-x' switch causes trace messages to be printed to STDERR during the script's execution. This is normally only armed for debugging.
Remove the '-x' switch from the interpreter line (#!/sbin/sh) to eliminate the STDERR or redirect STDERR to /dev/null when you execute the script ( e.g. /myscript 2> /dev/null ).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2005 12:09 AM
тАО11-29-2005 12:09 AM
Re: Problems on execute script
Thanks to all for your help.
Regards,
Carles