Help troubleshoot Linux Shell scripts

Posted on 2011-10-12
Last Modified: 2012-05-12

This question is related to past EE thread ids below:

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 calls
but somehow the dos2unix conversion in
did not work.  Inserting dos2unix in would work

Refer to attached

Question by:sunhux
    LVL 19

    Accepted Solution

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

    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).

    Author Comment


    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.

    Author Closing Comment


    Just a point to note is that in one other script, I forgot to
    prefix the datafile with $LOCAL_DIR  so it should be

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now