AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  script interactive shell

    Posted Fri December 13, 2013 12:48 PM

    Originally posted by: ddjen11


    Hi,

    AIX 5.3 script command does not support the  "-c" , is there a way to bypass the interactive shell so it can be used in a shell script?

    Thanks

    David

     

     



  • 2.  Re: script interactive shell

    Posted Fri December 13, 2013 03:55 PM

    Originally posted by: GarlandJoseph


    I guess you're talking about running -C <command>.  Can't you just reassign standard out and standard error  to achieve what you want?  Please give an example of what you want to run if there was such a -C switch in the aix 5.3's version of script.  i.e nohup <command> 2>stderr.out 1> stdout.err



  • 3.  Re: script interactive shell

    Posted Fri December 13, 2013 04:10 PM

    Originally posted by: ddjen11


    i am trying to capture the output of the sftp command, specifically this progress display:

    file_being_ftped                            100%  987    1.2KB/s 00:03

    This display is not saved by normal output redirect.

    I've found this command thru searching that will save everything that goes on screen (including prompt) to a file:

    script -q -c "sftp -b ... user@host" scr_out

    Problem is aix 5.3 does not support '-c' option, and when i try input redirect, pipe, or HERE doc, it just says:

    tcgetattr: A specified file does not support the ioctl system call.

    Any suggestions?

    Thanks.

     

     

     

     

     

     



  • 4.  Re: script interactive shell

    Posted Fri December 13, 2013 05:09 PM

    Originally posted by: GarlandJoseph


    Ok, I see, in this case sftp wants to write to a /dev/tty and so it' can't be redirected. I think the screen utility would work in this case if you have access to it.



  • 5.  Re: script interactive shell

    Posted Fri December 13, 2013 06:10 PM

    Originally posted by: ddjen11


    Thanks, unfortunately we dont have screen.

    i could manually run script with sftp & get the output (plus progress info)  that i  needed. Only thing is i need to automate the process. If it would just support "-c"...

     

     



  • 6.  Re: script interactive shell

    Posted Wed January 08, 2014 03:10 PM

    Originally posted by: BenGrossman


    try this...

     

    (sftp -b ... user@host) >scr_out 2>&1

     

    THe parenthesis should help with tty output, this works well with the time and times commands when you want to capture the "Real" time etc.



  • 7.  Re: script interactive shell

    Posted Fri January 10, 2014 03:45 PM

    Originally posted by: ddjen11


    thanks for the suggestion, it's still not getting the progressive bar/display, ie., not showing % of completion in succession.