Help troubleshoot Linux Shell scripts


This question is related to past EE thread ids below:
 27380638
 36915004
 36915222

Kindly refer to them 1st;  believe they're related but somehow
I can't figure out why the dos2unix conversion can't locate the
md5 checksum file.  It works for sftp put scripts though (as fixed
by the EE expert in the above thread ids), just that this sftp get
script did not work despite I implement the suggestion given above.
Perhaps I miss something

scr1.sh calls sftp_get_from_rem.sh
but somehow the dos2unix conversion in sftp_get_from_rem.sh
did not work.  Inserting dos2unix in scr1.sh would work

Refer to attached



sftpscrdos.txt
sunhuxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

simon3270Commented:
I've tried this and it seems to work on my ubuntu machine - hte .md5 fie is successfully converted by sftp_get_from_rem.sh.

Please add this just before the unix2dos lines:
    echo $LOCAL_DIR/$FILE_NAME.md5
    echo ls -l $LOCAL_DIR/*
    echo file $LOCAL_DIR/*

Open in new window

Then show us what is in the log file (sanitised for passwords etc if necessary).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sunhuxAuthor Commented:

Just realized I'm using a non-root UNIX id to run the script & the
dos2unix / unix2dos is not in this id's PATH.  So I'll need to prefix
the path for the dos2unix command.

Sorry, thanks for responding.
0
sunhuxAuthor Commented:
excellent.

Just a point to note is that in one other script, I forgot to
prefix the datafile with $LOCAL_DIR  so it should be
$LOCAL_DIR/$FILE_NAME
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.