insert output of sed into a variable
This is a shell-related question.
I would like to insert the ip address of the current x-server into a variable. If the Xdmcp-server and x-server are not the same computer, it looks like $DISPLAY gives <ip-adress>:<display-id> . for example: 192.168.0.31:0.0
Is it possible to remove the ':0.0' from $DISPLAY (probably with sed) and insert it into a new variable, like $DISPLAYHOST?
I allready searched the web for it, but I can't find any solution.
(I would like to run programs on the x-server while having a display of a different computer)
Thanks in advance
You can convert the output of any shell command or pipeline to a string by using backquotes (`).
For example, say you wanted to use some l33t encryption on some data, then send it to a variable for later use.
That worked .
THank you very much!
There are several way to do many things. Such a simple variable substitution could be done in bash.
If you wanted the DISPLAY#.SCREEN part:
|All times are GMT -5. The time now is 11:09 AM.|