package com.gentics.mesh.distributed.containers;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public final class UnixUtils {

	public static int getUid() throws IOException {
		InputStream in = null;
		try {
			String userName = System.getProperty("user.name");
			String command = "id -u " + userName;
			Process child = Runtime.getRuntime().exec(command);

			// Get the input stream and read from it
			in = child.getInputStream();
			String output = IOUtils.toString(in);
			return Integer.valueOf(output);
		} finally {
			if (in != null) {
				in.close();
			}
		}
	}

}

@@ -553,16 +553,23 @@
 f(output
+.trim()
 );%0A%09%09%7D f

Trim newlines from output string