sed -i "" '/This is a test/ c\
Is it Friday yet?\
Here is a breakdown of the above command.
The -i will edit the file in place.
The "" will get around not having an extension after the -i as required by os x.
c\ is the change flag. The above command is separated on multiple lines to make the c\ flag work properly. If you try to enter the command on one line, it will fail because the c\ has issues with escaping the backslash.
You could also use sed -i.bak which would create a backup of the file before it’s edited instead of the "".
The remainder of the command: replace the line that contains “This is a test” with “Is it Friday yet?” in the test.txt document.
This is a sed command to replace the word false with true in the updates.xml document.
sed -i "" 's/false/true/' /Users/work/Desktop/updates.xml
Step 2. Create a script named “postinstall” and put it in the scripts folder on the Desktop.
NOTE: do not add .sh to your script name or it will fail. Best practice is to use a plain text editor when creating scripts. IE.. TextWrangler or pico in the CLI.
Step 3. Run the following command. Enter your administrator password when prompted.
sudo pkgbuild --identifier com.mypackage.com --nopayload --scripts /Users/work/Desktop/scripts /Users/work/Desktop/MyPayFree.pkg
Step 4. The package will be created and saved to your desktop.
It requires a special VBoxManage command. This is the support method. Run the command below.
There are times when you come across a dmg image that has a larger disk geometry size than needed. This can cause issues if you try to restore a monolithic disk image to a volume smaller than your total dmg size. This is a common issue if Disk Utility was used to capture an Image of a Macintosh HD. To fix this issue, follow the commands below.