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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:48:57+00:00 2026-05-31T23:48:57+00:00

My teacher asked me to do a program using execlp that will do the

  • 0

My teacher asked me to do a program using execlp that will do the same as :
scp * mylogin@mycomputer:/home/mylogin/myfolder

I’ve tried :

execlp("scp", "scp", "*", "mylogin@mycomputer:/home/mylogin/myfolder", 0)

I found out that it doesn’t work since it’s the shell that convert * to files name.

Is there a way that I could do it, I don’t really know how I could get all the files names into the execlp call?

I’m sorry if i’m not clear, it’s just hard for me to explain 🙁 but I’m really looking for any tips on how the “*” works it would be great 🙂

  • 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-31T23:48:58+00:00Added an answer on May 31, 2026 at 11:48 pm

    You can use glob(3) to perform the glob match. Then allocate an array where you put the matching filenames and the other arguments to scp. You will not want to use execlp() but execvp() in this case as you now have an array instead of an argument list.

    However, the assignment by itself is rather stupid: If you want shell wildcard expansion, use system() which executes the given command in a shell (with all its advantages and disadvantages).

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

Sidebar

Related Questions

My teacher asked me to create a loop that will be executed 1M times.
i am new to program,and our teacher asked us to write a small program
My teacher has asked me to write a program in C# to handle Array
My teacher gave me this question: Write a program that does the following: Enter
Good day! Our teacher asked us to make a student list using a linked
I have taken an AI course, and the teacher asked us to implement a
A sysadmin teacher told me one day that I should learn to use make
We have studied the Variable Elimination recently and the teacher emphasizes that it is
I'm taking an online java class and the teacher has asked for the following:
I'm attempting to write a short mini-program in Python that plays around with force-based

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.