Question: I'm trying to write a bash script where part of a directory is a long, unknown string. I know the first part of the directory name. How do I combine the known string and the wildcard in the path? As of now, I have:

```
ID=$1;

IMP="adam@ocelot.cs.edu:/data/"$ID"/EER_DATA/$ID"*"/ImpostorScores.txt"

```

but this passes a literal `*`.

Answer: 
There are several options,

1. Use NFS or FUSE-over-SSH or something to expose the remote filesystem locally, then let `bash` apply the default `FOO=/*/passwd` glob on that exported filesystem path. (ZSH has a `${~spec}` glob substitution parameter expansion, otherwise see your shell's manual.)
2. SSH over to the remote system, and do the glob there. `ssh host 'echo /*/passwd'`
3. Pass the escaped (or otherwise defanged via backslash or single quotes) glob through to the remote system, `scp host:/\*/passwd .`

Some of these options are prone to race conditions should the filename change between when the glob is done and any subsequent steps involving that (possibly changed) filename.
The right side of a "Variable Assignment" is considered quoted (no splitting or globing):

```
LESS=+'/A variable may be assigned' man bash

```

> 
> A variable may be assigned to by a statement of the form:  
> 
>  name=[value]  
> 
>  Word splitting is not performed, ... . Pathname expansion is not performed.
> 
> 
> 

Therefore:

```
$ var=*
$ echo "$var"
*

```

---

To get an asterisk to expand, you need to use it un-quoted:

```
var="$(echo *)"                ### Expand to the list of files on pwd.

```

In your case:

```
$ ID=one
$ IMP="$( echo "adam@ocelot.cs.edu:/data/$ID/EER_DATA/"*"/ImpostorScores.txt")"
$ echo "$IMP"
adam@ocelot.cs.edu:/data/one/EER_DATA/something/ImpostorScores.txt

```

That something will be expanded if the whole path match, that is, a tree like this actually exists:

```
$ tree adam@ocelot.cs.edu\:/
adam@ocelot.cs.edu:/
└── data
    └── one
        └── EER_DATA
            └── something
                └── ImpostorScores.txt

```

Note: I removed the second `$ID` from your source, easy to re-place.