- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Background Job Completion Getting Written Into Var...
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
тАО06-20-2003 11:38 AM
тАО06-20-2003 11:38 AM
Hi,
I am running some CSH scripts that submit several jobs to the background. I start these scripts using -x -v and put the output to a log file. I notice that occassionally, certain variables are getting set with the job completion messages. It seems to be related to using eval echo. Has anyone seen this before? Any suggestions on how to work around this? Here is a sample failure below. In this case I am trying to set tmp2_count equal to $count24 which is 001. However, when I echo out $tmp2_count, it has some strange status message.
Thanks!
Ann
set tmp2_count = ( `eval echo \$count$test_number` )
set tmp2_count = ( `eval echo \$count$test_number` )
eval echo $count24
echo $count24
echo 001
echo $tmp2_count
echo Done csh -v -x /user_space/accounts/test/ 001
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2003 02:34 AM
тАО06-22-2003 02:34 AM
Re: Background Job Completion Getting Written Into Variables In CSH
What is 'set -o' from the command line?
# set -o
Current option settings
allexport off
bgnice on
emacs off
errexit off
gmacs off
ignoreeof off
interactive on
keyword off
markdirs off
monitor on
noexec off
noclobber off
noglob off
nolog off
nounset off
privileged off
restricted off
trackall off
verbose off
vi on
viraw off
xtrace off
Also, try or 'set -o xtrace' to debug at the top of your script. Turn off with 'set +o xtrace'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2003 04:50 AM
тАО06-23-2003 04:50 AM
Re: Background Job Completion Getting Written Into Variables In CSH
Thanks so much for the reply. I just reran my script after doing the following
unset noglob
This is cshell, so the set -o/+o doesn't work. But, unfortunately, I am still seeing this issue with this setting. Any other suggestions would be most appreciated.
Thanks!
Ann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2003 10:28 AM
тАО06-23-2003 10:28 AM
Re: Background Job Completion Getting Written Into Variables In CSH
eval set tmp2_count=\$count$test_number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2003 11:03 AM
тАО06-23-2003 11:03 AM
Re: Background Job Completion Getting Written Into Variables In CSH
Thanks for the last suggestion, but I do have some other cases where I am not setting a variable but rather testing for some condition and this error occurs. I am including a complete script below which replicates the problem on my system. While the code looks terrible, if you get the timing right, you will get the following error. Thanks again for all the suggestions.
Ann
@ i=0
while ($i < 500)
csh -x -v /scratch2/husp/foo/bogus_script.csh >>&! bogus.txt &
set count = $i
set test_number = 1
set count = `$Sitp_code/Sitp_C_utilities.EXE pad cnt $count`
set count$test_number = $count
if ( `eval echo \$count$test_number` != -1) then
echo foo
endif
if ( `eval echo \$count$test_number` != -1) then
echo foo
endif
if ( `eval echo \$count$test_number` != -1) then
echo foo
endif
@ i++
end
Where bogus_script.csh just increments a variable from 0 to 80 then exits. The error message I get is the following:
if ( `eval echo \$count$test_number` != -1 ) then
if ( `eval echo \$count$test_number` != -1 ) then
eval echo $count1
echo $count1
echo 000
`eval echo \$count$test_number`: Ambiguous.
[1] +Exit 1 csh -x -v /scratch2/husp/foo/bogus_script.csh >>&
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2003 12:19 PM
тАО06-23-2003 12:19 PM
Re: Background Job Completion Getting Written Into Variables In CSH
eval set result=\$count$test_number
if ( $result != -1) then
echo foo
endif
However, if you really want to use eval echo, then you could use "set notify" to change the way that background job completion is reported. That seems to prevent the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2003 04:35 AM
тАО06-24-2003 04:35 AM
Re: Background Job Completion Getting Written Into Variables In CSH
Thanks for the reply. I have checked the notify setting, and ran with it both set and unset and still saw these errors. I even tried directing the "Done" messages to a different file with the same results.
I am trying to replace all of my eval echo statements with eval set statements in order to test this. Some of the variables I am setting are multi-word variable. How would I do the eval set method to set these variables? For example:
eval set record = \$p$var
eval set record = $p0
set record = $p0
set record = 0 airco SUBMIT 1 10
set: Syntax error.
Thanks,
Ann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2003 07:26 AM