I need to write a script that would launch certain Support Consoles with SMIT for our Support Staff. Currently they have command line access but we are considering taking this option away from them. We would like to be able to launch smit from our current menu screen and allow them the ability to access the "smit print" screens. We are using AIX 4.2.1. Any help would be appreciated that could help to generate a script that would allow this. Thanks in advance for your help
Here is the code of a script that I have created but when I try to access the options from the menu I receive this error "1800-003 No tty on stdout; SMIT needs a terminal for normal interactive use. Use the -f flag to redirect stdin or stdout."
Not sure what I would need to change in the script to make it funtion properly. Any help would be appreciated.
#!/usr/local/bin/perl -w
$err_msg="Operation Failed Contact Help Desk";
$cl=system("clear"
$menu=<<'printq_menu';
Print Queue Reset Menu
1) Manage Print Jobs
2) Manage Print Queues
3) Print Queue Status
4) Exit
printq_menu
print $menu;
while($option = (<>))
{
#print $menu;
if($option=~/1/){
print "\nManage Print JObs\n";
`smit jobs`;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/2/){
print "\nManage Print Queues\n";
`smit pqmanage`;
print $menu;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/3/){
print "\nStatus of Print Queues\n";
`lpstat`;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/4/){
exit;
}}}}}
Here is the code of a script that I have created but when I try to access the options from the menu I receive this error "1800-003 No tty on stdout; SMIT needs a terminal for normal interactive use. Use the -f flag to redirect stdin or stdout."
Not sure what I would need to change in the script to make it funtion properly. Any help would be appreciated.
#!/usr/local/bin/perl -w
$err_msg="Operation Failed Contact Help Desk";
$cl=system("clear"
$menu=<<'printq_menu';
Print Queue Reset Menu
1) Manage Print Jobs
2) Manage Print Queues
3) Print Queue Status
4) Exit
printq_menu
print $menu;
while($option = (<>))
{
#print $menu;
if($option=~/1/){
print "\nManage Print JObs\n";
`smit jobs`;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/2/){
print "\nManage Print Queues\n";
`smit pqmanage`;
print $menu;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/3/){
print "\nStatus of Print Queues\n";
`lpstat`;
#else{
if($? > 0){
print $err_msg;
exit;
}}
else{
if($option=~/4/){
exit;
}}}}}