|
From: invincible on 22 Apr 2008 04:40 On Apr 21, 7:16 pm, Ed Morton <mor...(a)lsupcaemnt.com> wrote: > On 4/21/2008 10:53 AM, invincible wrote: > > > > > All, > > Im trying to execute some commands on remote server thorugh script and > > ssh. > > When I run a normal command from prompt I do not get any error > > messages but > > when I run it thorugh script I get the execute permission denied > > message. > > Script is as below > > > #Checking the presence of tasks file > > USR=abcd@ > > LISTSERVER="dubba libba" > > OUTFILE=/home//testing/scriptoutput > > #Create new file > > >>$OUTFILE > > > #Connect each server and pull up the listing > > for host in $LISTSERVER > > do > > echo "------------------------------------------------" >>$OUTFILE > > echo " * HOST : $host " >>$OUTFILE > > ssh $USR$host "more /home/apps/conf/tasks.tbl|awk '{print \$1}'" > > >>>OUTFILE > > > done > > > The error enounterd is ... > > ./check_ps > > /home/apps/conf/tasks.tbl: The file access permissions do not allow > > the > > specified action. > > I can although run the command ssh USR$host "more > > /home/apps/conf/tasks.tbl|awk '{print \$1}'" on the command prompt and > > get > > the desired result. > > Hoping for some inputs.... __.____._ > > I don't think it's related to your problem, but Im curious: what do you think this: > > more file | awk '...' > > does better than: > > awk '...' file > > and why "more" rather than "cat"? > > Regards, > > Ed I had some issues with cat initialliay , but I have now replaced the cat. and it seems to solve the issue out.
From: Ed Morton on 22 Apr 2008 07:52
On 4/22/2008 3:40 AM, invincible wrote: > On Apr 21, 7:16 pm, Ed Morton <mor...(a)lsupcaemnt.com> wrote: > >>On 4/21/2008 10:53 AM, invincible wrote: >> >> >> >> >>>All, >>>Im trying to execute some commands on remote server thorugh script and >>>ssh. >>>When I run a normal command from prompt I do not get any error >>>messages but >>>when I run it thorugh script I get the execute permission denied >>>message. >>>Script is as below >> >>>#Checking the presence of tasks file >>>USR=abcd@ >>>LISTSERVER="dubba libba" >>>OUTFILE=/home//testing/scriptoutput >>>#Create new file >> >>>>$OUTFILE >>> >>>#Connect each server and pull up the listing >>>for host in $LISTSERVER >>>do >>>echo "------------------------------------------------" >>$OUTFILE >>>echo " * HOST : $host " >>$OUTFILE >>>ssh $USR$host "more /home/apps/conf/tasks.tbl|awk '{print \$1}'" >> >>>>>OUTFILE >>>> >>>done >> >>>The error enounterd is ... >>>./check_ps >>>/home/apps/conf/tasks.tbl: The file access permissions do not allow >>>the >>>specified action. >>>I can although run the command ssh USR$host "more >>>/home/apps/conf/tasks.tbl|awk '{print \$1}'" on the command prompt and >>>get >>>the desired result. >>>Hoping for some inputs.... __.____._ >> >>I don't think it's related to your problem, but Im curious: what do you think this: >> >> more file | awk '...' >> >>does better than: >> >> awk '...' file >> >>and why "more" rather than "cat"? >> >>Regards, >> >> Ed > > > I had some issues with cat initialliay , but I have now replaced the > cat. and it seems to solve the issue out. OK, but hopefully you realise you don't need "cat" at all in this example and by "replaced" you actually mean "removed"... Ed. |