-2

I'm a newbie in Linux. I can run this command directly in Terminal:

7za t -p' \' -w -y /root/test2.7z | grep -i OK

I trying a script (named test_script.sh) for 7zip file password testing:

7za t -p$1 -w -y /root/test2.7z | grep -i OK

but cannot get result with this script:

sh /root/test_script.sh ' \'

Update running result:

[root@localhost ~]# sh /root/test_script.sh ' \'
7za t -p \ -w -y /root/test2.7z | grep -i OK
ERROR: No more files
\
System ERROR:
Unknown error 18446744071562526744

[root@localhost ~]# sh /root/test_script.sh " \"
> 
> 
> 

Terminal hanging, maybe waiting a next command.

Please help me how to pass the parameters " \".

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

Thanks Rici. The script worked. 7za t -p"$1" -w -y /root/test2.7z | grep -i OK Run sh /root/test_script.sh ' \'