Sponsored Content
Top Forums Shell Programming and Scripting Output formatting help needed. Post 302367528 by pinga123 on Tuesday 3rd of November 2009 01:48:08 AM
Old 11-03-2009
Output formatting help needed.

Hi guys ,
I have a file which contains following string.(filename tempdisplay)
(location 0.0.0.0:5900)

i needed to write a script which will extract the string that comes after
0.0.0.0 i.e the string :5900.

I have used following method to extract the string :5900 .Is it a preferred way of doing the job as following script will create two files?

Code:
sed s/"(location 0.0.0.0"/""/ tempdisplay > temp2display
#temp2display will now contain :5900)
temp=`sed s/")"/""/ temp2display`
#temp will now contain :5900
echo $temp

output:
:5900

Last edited by pludi; 11-03-2009 at 03:16 AM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Formatting the output

Hi all, Have the following code(1) producing the results(2 & 3). Would like to know if there is a way to format the two reports created in a similar fashion. IE - The first is formatted nicely as a result of the echo "$xmpbdate $xavgs" >> $xmpbrpt However when I attempt to do the same on... (7 Replies)
Discussion started by: Cameron
7 Replies

2. Shell Programming and Scripting

Little formatting help needed.

I have a following string. "machine=IFLMUD5HP0581&group1=Stop" I have created 2 variables namely machine and action. machine should contain IFLMUD5HP0581 action should contain Stop How do i write a script for the same. (7 Replies)
Discussion started by: pinga123
7 Replies

3. Shell Programming and Scripting

Formatting Help needed(Sed)

I have a file called abc.txt which has following contents. 10.180.8.231=31608 10.180.8.232=29011 10.180.8.233=31606 10.180.8.234=40501 10.180.8.235=32591 10.180.8.236=31605 10.180.8.237=30561 10.180.8.238=14231 How would i find a ip address having maximum number of ram available. Here... (2 Replies)
Discussion started by: pinga123
2 Replies

4. UNIX for Dummies Questions & Answers

Formatting Help needed

How would i write a script which will add a following content to a file. File Before running script. acpi = 1 apic = 1 builder = 'hvm' device_model = '/usr/lib/xen/bin/qemu-dm' disk = File After running the script. acpi = 1 apic = 1 builder = 'hvm' device_model =... (5 Replies)
Discussion started by: pinga123
5 Replies

5. Shell Programming and Scripting

Formatting help needed awk or sed maybe

I am executing the following command: sort file1.txt | uniq -c | sort -n > file2.txt The problem is that in file 2, I get leading spaces, Like so: 1 N/A|A8MW11 8 N/A|ufwo1 9 N/A|a8mw11 10 900003|smoketest297688 10 N/A|a9dg4 10 danny|danni 12... (5 Replies)
Discussion started by: ddurden7
5 Replies

6. Shell Programming and Scripting

Help needed in formatting script files

Hi, Can anyone tell me how i can convert all tab spaces inside a script to 4 spaces through another script. Also i need to find if all the quotes are matching and ended properly. Any idea whould be of great help. Many thanks! (3 Replies)
Discussion started by: justchill
3 Replies

7. AIX

Help Formatting Output

I am using FORTRAN 90 on AIX 5.3 and need to output my data to a tab-delimited file. It must have actual tabs, and I cannot figure out a way to make it work. The resulting file will be imported into another application (quickbooks) as an .iif file....for some reason, it needs the tabs; spaces do... (2 Replies)
Discussion started by: KathyB148
2 Replies

8. Shell Programming and Scripting

Formatting output

I have the output like below: DEV#: 9 DEVICE NAME: hdisk9 TYPE: 1750500 ALGORITHM: Load Balance SERIAL: 68173531021 ========================================================================== Path# Adapter/Path Name State Mode Select Errors 0 ... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

9. Shell Programming and Scripting

Help needed in formatting the Output file

Hi All, Need your help in resolving the below issue. I've a file called "data.txt" with the below lines: TT: <tell://me/sreenivas> <tell://me/100> TT: <tell://me/sudheer> <tell://me/300> TT: <tell://me/sreenivas> <tell://me/200> TT: <tell://me/sudheer> <tell://me/400> ... (3 Replies)
Discussion started by: raosr020
3 Replies

10. Shell Programming and Scripting

Help needed in formatting the output

Hi All, Need your help in resolving the below issue. I've a file called "data.txt" with the below lines: TT: <tell://me/sreenivas> <tell://me/100> <tell://me/500> TT: <tell://me/sudheer> <tell://me/300> TT: <tell://me/sreenivas> <tell://me/200> TT:... (6 Replies)
Discussion started by: raosr020
6 Replies
VINAGRE(1)						      General Commands Manual							VINAGRE(1)

NAME
vinagre - a remote desktop viewer for the GNOME Desktop SYNOPSYS
vinagre [OPTIONS] [server][::port|:display] DESCRIPTION
vinagre is a remote desktop viewer for the GNOME desktop. It can support many protocols using a plugin system. Current plugins exist for VNC and SSH. Vinagre has many features, among others:. - Support for multiple connections simultaneously - Bookmarks and history support - Avahi integration - GNOME keyring integration - GNOME panel applet to quickly launch vinagre to access VNC servers - You can connect to a VNC server by double clicking on a .vnc file when using nautilus. OPTIONS
Help Options: -?, --help Show help options --help-all Show all help options --help-gtk Show GTK+ options Application Options: --help-vnc Show VNC options -F, --file=filename Opens a .vnc file -f, --fullscreen Open vinagre in fullscreen mode -n, --new-window Create a new toplevel window in an existing instance of vinagre --display=DISPLAY X display to use Run 'vinagre --help' to see a full list of available command line options OPERANDS
The following operands are supported: [server][::port|:display] Specifies the VNC server to connect to. The VNC server can be either a hostname, or an IP address. If the server is an IPv6 address, it must be enclosed by square brackets. The address can optionally be followed by two colons (::) and the VNC port number, or alter- natively by one colon (:) and the display where Vinagre should run. If a port is not specified, default value of 5900 will be used. If the value is lower than 1024, 5900 will be added to it. For example, ":0" means "5900" and ":1" means ":5901". If only a port is specified, but not the hostname, localhost will be assumed. Possible values for the display are between 0 and 1024. If a display number greater than 1024 is specified, it will be assumed to be a port. Note that you can't specify the port and the display at the same time. EXAMPLES
Example 1: Start vinagre from the command line example% vinagre Example 2: Create a new top-level window example% vinagre --new-window Example 3: Connect to a specified VNC server and port example% vinagre snoopy::5900 Example 4: Connect to a specified IPv4 address and port example% vinagre 192.168.1.35::2700 Example 5: Connect to a specified IPv6 address and port example% vinagre [2001:0db8:0:0:0:0:1428:57ab]::2700 Example 6: Connect to a VNC server specified by a .vnc file example% vinagre -F snoopy.vnc Example 7: Connect to localhost on a specified port in fullscreen mode example% vinagre -f ::5900 SEE ALSO
Vinagre help manual AUTHOR
Vinagre was written by Jonh Wendell <wendell@bani.com.br> This manual page was written by Emilio Pozuelo Monfort <pochu@ubuntu.com> and Halton Huo <halton.huo@sun.com>. User Commands August 12th 2009 VINAGRE(1)
All times are GMT -4. The time now is 04:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy