My Unix command

25 pts.
Tags:
Unix
Unix administration
I got a problem with my Unix script as below. Error Message: cannot open: No such file or directory mv: cannot access [source language="file"][/source] My scripts as below. Anyone have any idea? Pls help~~ file ${epmhome}/receive/${datfile}.err set stat=${status} if (${stat} != 0) then echo "No Error File Found at Receive" else mv ${epmhome}/receive/${datfile}.err ${epmhome}/error/${getfile}.err echo "Error File Found: `date '+%T'`" endif

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I can't tell about this line:
    mv: cannot access [source language="file"][/source]
    Is that exactly the way the message looked?   Tom  
    125,585 pointsBadges:
    report
  • TomLiotta
    Hmmm... that did not show up the way I entered it. The stuff in square brackets was removed by the {code} process. If the {code} button can't display exactly what's entered, it's broken.   mv: cannot access [source language="file"][/source]   Maybe plain-text is good enough.   Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Nope. Apparently discussion comments can't put that string in square brackets.   mv: cannot access {source language="file"}{/source}   So I'll change them to curly braces.   Tom
    125,585 pointsBadges:
    report
  • kimuki
    Hi, the actual error message is as below:/home/pxgkl/prod/receive/pxdpr.dat.err: cannot open: No such file or directorymv: cannot access /home/pxgkl/prod/receive/pxdpr.dat.err
    25 pointsBadges:
    report
  • TomLiotta
    The mv command cannot find a file of that exact name. Don't try to mv a file unless your script tests that the file exists, or retrieve the names of files from the directory and use retrieved names. If you construct a name from variables or parameters, there's no guarantee there will be an exact match. -- Tom
    125,585 pointsBadges:
    report
  • kimuki
    Thanks for the tips.I've tried using * behind the file and there's no more error message shown. :) hopefully this help
    25 pointsBadges:
    report
  • jackieserver
    Are you sure that the file exist and is on that place?
    180 pointsBadges:
    report
  • jackieserver
    And is the problem solved already or not? If the answer is yes what was the solution. It is nice toe share the solution for users who have the same problem
    180 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following