The proper format for that is
cp "$DIR/working-dir/shswitch_${codesite}_${ip}_"*"_OUTPUTCONFIG" "$LOCALDIR/liste/$hostname-$ip"
Вопрос
i'm here for a little misunderstanding issue.
Here's what i have :
cp "$DIR/working-dir/shswitch_'$codesite' _ '$ip' _ '*' _ OUTPUTCONFIG" "$LOCALDIR/liste/$hostname-$ip"
I want to search for a file which contains words described as var, and a random number in the middle of the file's name like this :
shswitch_313083_126.138.36.253_**11894**_OUTPUTCONFIG
and copy it elsewhere. When i'm trying this above, that's what linux says :
cp: cannot stat `/opt/exploit/dev/florian/scan-allied/working-dir/shswitch_\'313083\'\'126.138.36.253\'\'*\'_OUTPUTCONFIG': No such file or directory
I don't understand why is there backslash in here, and neither why he won't search properly my file. Can you help please ?
Решение
The proper format for that is
cp "$DIR/working-dir/shswitch_${codesite}_${ip}_"*"_OUTPUTCONFIG" "$LOCALDIR/liste/$hostname-$ip"