onepub-dev / onepub-dev/dcli

quoting for scp call

Open
#105 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
265
Forks
30
PR merge metrics
No merged PRs in 30d

Description

I had the following call to scp:

'scp $oldHost:/etc/asterisk/sip.d/* $tmpRoot/'.run;

The call failed as the '*' was being expanded locally and we ended up with a fully qualified path of the form:

`scp /home/me/www.microsoft.com.au:/etc/asterisk/sip.d/* /remote/path'.run.

I got around this problem by quote the local path:

'scp $oldHost:"/etc/asterisk/sip.d/*" $tmpRoot/'.run;

However this dones't feel right.

Maybe we need to reconigize the presense of the ':' or perhaps any other non-path character and then do the expansion.

Of course in this case any expansion of the '*' is wrong (as its meant to be a path on the remote system).

We need to have a look at how bash is handling this situation and provide an equivalent implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the scp command from the issue and compare its wildcard behavior with bash. Find the dcli command-parsing or expansion entry point, then trace how the colon in the remote path is handled. Done means remote wildcards are not expanded locally while ordinary local expansion continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, dart
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.