0

I want a few of my statements from my preinstall script to be visible to the user also (not just getting logged in install.log ) when my package is installed (via terminal).

Example : when my .pkg is called via the command "sudo installer -pkg /path/to/package -target /" , I want to print out "Thanks for installing my application" in the terminal itself

1

This is simple you can ua the following ways:

command | tee output.txt

The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten. command | tee -a output.txt

The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.

If you want any to know where I got this here is the reference:https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file/420983 @Byte Commamder.

  • In my preinstall script I had tried echo "SomeRandomComment" | tee -a /private/var/log/install.log but when installing the package via "sudo installer -pkg /path/to/package -target /" , I am not getting the "SomeRandomComment" displayed in my terminal – R.Srinath Nov 16 '17 at 14:08
  • Try sudo installer -pkg /path/to/package -target / | tee /path/to/output – user244378 Nov 16 '17 at 14:16
  • I want the comment to be visible in the terminal itself. – R.Srinath Nov 16 '17 at 14:28
  • This command should work have you tried it? – user244378 Nov 16 '17 at 14:29
  • this command works for me it both logs the output to the file and visible in the terminal screen. – user244378 Nov 16 '17 at 14:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .