I am unable to invoke the sed command from the perl script as below:
#!/usr/bin/perl
my $cmd = ('sed 's/...........//;s/............$//' a_file.txt >> a_newfile.txt');
system($cmd);
Below is the error:
String found where operator expected at ./test.pl line 2, near "s/............$//' a_file.txt >> a_newfile.txt'"
syntax error at ./test.pl line 2, near "'sed 's/...........//"
syntax error at ./test.pl line 2, near "s/............$//' a_file.txt >> a_newfile.txt'"
Execution of ./test.pl aborted due to compilation errors.
I need to remove the <shortname>u********.com</shortname> in the file and save the output in a new file. Which commands do I need to run?
sedfromperl?