Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "tar: Invalid transform expression"while I am creating a TAR using system command in ruby. Why?

I am creating a TAR using system command in ruby, passing a array as argument
which look likes this:

cmd_params = ["tar", "-cf", "my.tar", "wp-signup.php_1433243457_25152", "--transform='s/_[0-9]*_[0-9]*$//g'"]
system(*cmd_params)

But getting an Error

tar: Invalid transform expression

is there any way out for doing this ??

like image 882
ritzz.soni Avatar asked Oct 24 '25 08:10

ritzz.soni


1 Answers

The single quotes are needed on the command line or in a shell script to prevent the shell from interpreting the special characters. They're not needed here.

like image 193
choroba Avatar answered Oct 26 '25 01:10

choroba