How to expand shell variables in a text file?

This question has been asked in another thread, and this is the best answer IMO: export LOG_FILE_PATH=/expanded/path/of/the/log/file/../logfile.log cat Text_File.msh | envsubst > Text_File_expanded.msh if on Mac, install gettext first: brew install gettext see: Forcing bash to expand variables in a string loaded from a file

What process is listening on a certain port on Solaris?

I found this script somewhere. I don’t remember where, but it works for me: #!/bin/ksh line=”———————————————” pids=$(/usr/bin/ps -ef | sed 1d | awk ‘{print $2}’) if [ $# -eq 0 ]; then read ans?”Enter port you would like to know pid for: ” else ans=$1 fi for f in $pids do /usr/proc/bin/pfiles $f 2>/dev/null | … Read more

Difference between an inline function and static inline function

The non-static inline function declaration refers to the same function in every translation unit (source file) that uses it. The One Definition Rule requires that the body of the function definition is identical in every TU that contains it, with a longish definition of “identical”. This is usually satisfied provided that the source files all … Read more

What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]

Here is a rough explanation of the concepts. [ACK] is the acknowledgement that the previously sent data packet was received. [FIN] is sent by a host when it wants to terminate the connection; the TCP protocol requires both endpoints to send the termination request (i.e. FIN). So, suppose host A sends a data packet to … Read more

How to use qemu to run a non-gui OS on the terminal?

You can compile qemu for youself and install it into your home directory. There will be no kernel-mode qemu accelerator, but the qemu will work and the speed will be rather high. Qemu has two options for non-gui start: http://wiki.qemu.org/download/qemu-doc.html 2.3.4 Display options: -nographic Normally, QEMU uses SDL to display the VGA output. With this … Read more