Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help with Sudo command in Unix script

user4039570Apr 3 2013 — edited Apr 4 2013
Hi There,
I have an etl job, with source as csv files.
My source team drops files at a location. I have an unix script, that moves these files to my source file directory. And loads these files one at a time.

When my source team does not send a file, my job fails.
So i want to put a dummy file, at a location where my src team drops files, when src team does not send a file.
it says donot have privilege, so I did a sudo still it is giving error below;
----------------------------------------
sudo su - etltest
cd /d11/OBISTG/obidata1/cos/ --- src team drops file here

filecount=`ls -lt AR_DATAMART_COS* | wc -l`

if [[ $filecount -eq 0 ]]; then
echo 'AR_DATAMART_COS.Dummy.99990101.000000.csv' > NavisionfileList.txt
fi

ls AR_DATAMART_COS* >>NavisionfileList.txt
-------------------------------------

Error:
sudo su - etltest
+ sudo su - etltest
sudo: sorry, you must have a tty to run sudo

any ideas pls?

Thanks,
Rag
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2013
Added on Apr 3 2013
3 comments
537 views