Home > OS >  Shell script contains the sed command, after converted to executable error sed: can 't read/hom
Shell script contains the sed command, after converted to executable error sed: can 't read/hom

Time:10-08

Please input in the Linux terminal 2 command:
Sed -i "s/` cat TBCxiug dat | awk '{print $2}' | awk 'NR 74=={print}' `/` cat a.t xt | awk '{print $2}' | awk 'NR==1 {print}' `/g" TBCxiug. Dat
/opt/software/.../nessus/opt/software/.../license. TXT/home/.../TBCxiug probabilistic verbose z
To perform and get the corresponding results (don't pay attention to the second command, it is called a case called nessus software calculation)

I put the above two commands written to the file. TXT,
#!/bin/sh
Sed -i "s/` cat TBCxiug dat | awk '{print $2}' | awk 'NR 74=={print}' `/` cat a.t xt | awk '{print $2}' | awk 'NR==1 {print}' `/g" TBCxiug. Dat
/opt/software/.../nessus/opt/software/.../license. TXT/home/.../TBCxiug probabilistic verbose z

And chmod + x file. TXT into executable,./file. TXT after the operation, an error is as follows:
/opt/software/NESSUS - 9.5/bin/Linux/NESSUS: No to the file or directory
Sed: can 't read/home/xiaoyq/Desktop/NESSUS_Temp/TBCxiug: No to the file or directory
Sed: can 't read probabilistic: No to the file or directory
Sed: can 't read verbose: No to the file or directory
Sed: can 't read z: No to the file or directory


To analysis the reason, for solving

CodePudding user response:

Sed to not find a file or directory, do you see the path problem, it is best to use the absolute path to the file

CodePudding user response:

reference 1st floor Empty_city_dreams response:
sed not find a file or directory, do you see the path problem, it is best to use the absolute path to the file

But I did not make mistake when a losing a command, and in fact the second command and sed it doesn't matter

CodePudding user response:

TBCxiug. Dat in that place, the script again?? Put together

CodePudding user response:

The
reference 3 floor Empty_city_dreams response:
TBCxiug. Dat in that place, the script again?? Put together the

In the same folder,
  • Related