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 8504099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:55:59+00:00 2026-06-11T01:55:59+00:00

I want change a working directory in an awk script: … path=./some/path system(pwd) ;

  • 0

I want change a working directory in an awk script:

  ...
  path="./some/path"
  system("pwd") ; \
  current_dir=system("pwd") ; \
  pushd_cmd="pushd " path ; \    # a "cd" doesn't work too
  print pushd_cmd ; \
  system(pushd_cmd) ; \
  system("pwd"); \               # the same directory as before
  type="xml"
  ls_cmd = "ls *." type;         # so I can't find the files. Specifying with "./some/path/*.xml" doesn't work too (without trying to change the working directory)
  ...

Does somebody know why system does no effect in my case?

  • 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-06-11T01:56:01+00:00Added an answer on June 11, 2026 at 1:56 am

    system will launch a sub-process, and a sub-process cannot alter the working directory of its parent.

    A quick Google search reveals the following section of the GNU AWK documentation: http://www.gnu.org/software/gawk/manual/html_node/Internal-File-Description.html#Internal-File-Description

    It seems to imply that standard AWK does not have a method of changing the working directory. (And in GNU AWK you can do it with chdir as you see.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an online booking system, basically I want a textbox to change
pwd is present working directory. Here's the situation. pwd: /path/to/pwd/ git repository: /repo/path/.git/ I
I want to write a perl script that changes its working directory to somewhere
Is it possible to change the Windows command prompt working directory via Python script?
I want to run a java program in Linux and change its working directory
i am working with wpf media element.i want to change the media element source
I have an working application. Now I want to change the table names of
I'm working on a project where we want to dynamically change the IP address
I am working on Drupal. I want to know how to change that footer
Basically I want to spawn a process changing its working directory. My idea was

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.