Jump to content

Help with perl


BlackCH
 Share

2 posts in this topic

Recommended Posts

Hello people; Im trying this line:

 

perl -pi -e 's/^(<key>device-properties</key>)/$1."\n".`cat ~/Desktop/string.txt`/e' ~/Desktop/boot.plist

 

To insert the efi string in string.txt file onto boot.plist, right after the '<key>device-properties</key>' line . Theres something wrong with the syntaxis and I couldnt figure out how (Im new to this). If someone can tell me what will be the right way to put this I will apreciate!

 

thanks

Link to comment
Share on other sites

I got to this:

 

line="Inserthere"
string=$(cat ~/Desktop/boot1.plist) 
file="User/dlow/Desktop/txt.plist"
echo "cat is $string"

sudo perl -pi -e 's/(^"$line")/$1."\n"."$string"/e' /$file

exit 0

 

Now I dont get syntaxis errors but now I get

'Can't do inplace edit: FILE is not a regular file '

still need some help

Link to comment
Share on other sites

 Share

×
×
  • Create New...