Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3340436
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:36:27+00:00 2026-05-18T00:36:27+00:00

I tried to run a command by reading it from a textfile, but it

  • 0

I tried to run a command by reading it from a textfile, but it failed. when i enter the exact same line it is working, tough. im suprised that it did even try to execute the move command, but got an errormessage that translates to “File or directory not found”. obviously the errormessage is not telling the truth here. can someone explain that?

s39339@compute:~/spr/man/de$ head -n7 mkdoc|tail -n1
mv nutzer.1.gz ~/public_html/man/man1/
s39339@compute:~/spr/man/de$ `head -n7 mkdoc|tail -n1`
mv: Verschieben von „nutzer.1.gz“ nach „~/public_html/man/man1/“ nicht möglich: Datei oder Verzeichnis nicht gefunden
s39339@compute:~/spr/man/de$ ls
gzip  mkdoc  nutzer.1  nutzer.1.gz  nutzer.pod  rbsh
s39339@compute:~/spr/man/de$ mv nutzer.1.gz ~/public_html/man/man1/
s39339@compute:~/spr/man/de$

I am doin this for school so an answer would be nice. the way we get to our results doesn’t matter, although what i tried seems way unnessecary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:36:27+00:00Added an answer on May 18, 2026 at 12:36 am

    `head -n7 mkdoc|tail -n1` is replaced by the output of the command, which is mv nutzer.1.gz ~/public_html/man/man1/. This output is then interpreted as a command, a mv command.

    It fails, though, because tilde expansion has already been performed. ~ is not substituted with your home directory at this point; it’s just a plain tilde character. It’s as if you had tried to execute

    'mv' 'nutzer.1.gz' '~/public_html/man/man1/'
    

    For the same reason you cannot use $HOME, or a second set of backticks, or any other dynamic construct. To do that you will need to use eval, or pass the string to a second shell.

    eval `head -n7 mkdoc|tail -n1`
    bash -c "`head -n7 mkdoc|tail -n1`"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to run the command telnet localhost 5554 in the command line, but
I tried to run 2 JQuery-ajax at the same time, but it's seem always
I tried to run the following command and it says there is nothing to
How do I run this command with subprocess? I tried: proc = subprocess.Popen( '''ECHO
I tried to run the directx samples from ..\Windows Mobile 6 SDK\Samples\PocketPC\CPP\win32\directx\d3dm\tutorials on a
I tried to run VBA application on someone else's computer, but I get an
I'm trying to run a command via command prompt from an ASP.Net web application.
I tried to run both command aapt v android list in Ubuntu 10.10 terminal
I'm trying to run an interactive command through paramiko. The cmd execution tries to
When I run gem install <somegem> command the gem utility tries to access my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.