質問

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"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top