Sponsored Content
Top Forums Shell Programming and Scripting Linux command to output from a string Post 302700525 by in2nix4life on Thursday 13th of September 2012 01:59:59 PM
Old 09-13-2012
Code:
echo "/iis_ft_dev_data1/custsys/publish/goldstd/WCC_CUST_GS_NON_TRAN_CTA_DLY.dat" | sed -n 's/.*_\(.*\)\.dat/\1/p'

DLY

This User Gave Thanks to in2nix4life For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

How to Run a Linux Command and Redirect its output to a socket in C

I have a Linux socket server program. I need to run the commands sent by the client and return the output to client. Is there a quicker way? I tried with ptr=popen(command, "r"); and then fgets(buf, size,ptr); write buf to socket fgets hangs for me. Now, I would like to know if I can... (3 Replies)
Discussion started by: rajeshomallur
3 Replies

2. Shell Programming and Scripting

grep only a string on command output

How can I grep exactly a string that has .,/ characters using grep? Example: I want to grep ONLY string1 and not string1.more or string1.more.evenmore #lsauth ALL|grep 'string1' All output: string1 <--- This is the only I want. string1.more string1.evenmore. more.string1... (4 Replies)
Discussion started by: iga3725
4 Replies

3. Shell Programming and Scripting

Command output string manipulation possible in one line?

This has been bothering me for 3 days. $> hostname cepsun64amd And I just want "cepsun", I would normally do h=`hostname`; ${h%%64*} But I am looking for a one-liner just for my own knowledge, because if there is a way to do this, I should know it by now. Anyway, so is this... (2 Replies)
Discussion started by: Ryan.
2 Replies

4. UNIX for Dummies Questions & Answers

linux sort command produces strange output

cat a .a ba .b bb .c bc sort a .a .b ba bb bc .c NOTE: .a and .b appears before ba and bb, where as .c appears after bc. In general (3 Replies)
Discussion started by: ajb
3 Replies

5. Shell Programming and Scripting

Grep command showing wrong output in Linux

Hi All I am trying to run a script in linux wherein i have a command like this grep ^prmAttunityUser= djpHewr2XFMAttunitySetup_ae1_tmp djpHewr2XFMAttunitySetup_ae1_tmp is a temporary file in which the user value is stored but this command in the script returns me balnk value whereas it has a... (4 Replies)
Discussion started by: vee_789
4 Replies

6. UNIX for Dummies Questions & Answers

LINUX - How to remove the final delimiter from a command output

Hi All, I am trying to list the various dates for which the file is available in a directory using the command below, (& subsequently pass the command output to a loop) Command : ls dir|grep 'filename'|cut -d '_' -f1|cut -c1-8|tr '\n' ',' However, it is giving me an extra comma... (6 Replies)
Discussion started by: dsfreddie
6 Replies

7. Shell Programming and Scripting

Want to terminate command execution when string found in the command output

Hi Experts, I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task. I am running below command to snmpwalk the router.. snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
Discussion started by: Hanumant.madane
19 Replies

8. Shell Programming and Scripting

Different output for awk command on Linux & HP-UX

I am using an awk command to extract a particular portion of a string. Below is the command and its output on a Linux system: oracle@host1:/tmp (/home/oracle) $uname -a Linux host1 2.6.32-279.39.1.el6.x86_64 #1 SMP Fri Nov 15 05:38:26 EST 2013 x86_64 x86_64 x86_64 GNU/Linux ... (7 Replies)
Discussion started by: veeresh_15
7 Replies

9. Shell Programming and Scripting

Help with Passing the Output of grep to sed command - to find and replace a string in a file.

I have a file example.txt as follows :SomeTextGoesHere $$TODAY_DT=20140818 $$TODAY_DT=20140818 $$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script. (It would even be better if I could pass... (5 Replies)
Discussion started by: SriRamKrish
5 Replies

10. UNIX for Beginners Questions & Answers

Interpreting Linux's free command output

I have two questions on Linux's free command. Below, I have provided output from my home laptop (fedora 26 ) which has 16GB Physical RAM and a production server (RHEL 7.4) which has 24GB RAM. Question1. What exactly does the buffer/cache column say in free command's output ? buffer/cache is... (9 Replies)
Discussion started by: omega3
9 Replies
avahi-publish-service(1)				      General Commands Manual					  avahi-publish-service(1)

NAME
avahi-publish-service - Register an mDNS/DNS-SD service or host name or address mapping using the Avahi daemon SYNOPSIS
avahi-publish -s [options] name service-type port [TXT data ...] avahi-publish-service [options] name service-type port [TXT data ...] avahi-publish -a [options] host name address avahi-publish-address [options] host name address DESCRIPTION
Register an mDNS/DNS-SD service or host name/address mapping using the Avahi daemon. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon. OPTIONS
When calling in service registration mode, specify a DNS-SD service name (e.g. "Lennart's Files"), a service type (e.g. _http._tcp) and an IP port number for the service, optionally followed by any number of TXT record strings on the command line. When calling in address/host name registration mode specify a fully qualified host name and an address (IPv4 or IPv6). -s | --service Register a service. avahi-publish-service is equivalent to avahi-publish -s. -a | --address Register an address/host name mapping. avahi-publish-address is equivalent to avahi-publish -a. -v | --verbose Enable verbose mode. -H | --host= HOSTNAME Specify a host name for this service, in case it doesn't reside on the local host. This host name needs to be fully qualified and resolvable using mDNS or unicast DNS. -d | --domain= DOMAIN Publish the service in the specified domain. If omitted the Avahi daemon will publish it in its default domain (usually .local). --subtype= SUBTYPE Register the service with an additional subtype in addition to the main type. DNS-SD subtypes have the form _anon._sub._ftp._tcp, where _anon is the identifier of the subtype and _ftp._tcp is the main type. You may pass this option multiple times to register the service with multiple subtypes. -f | --no-fail Don't fail if the daemon is not found running. Instead, wait until it appears. If it disconnects, try to reconnect. -h | --help Show help -V | --version Show version information. SEE ALSO
avahi-resolve(1), avahi-browse(1) COMMENTS
This man page was written using xml2man(1) by Oliver Kurth. Manuals User avahi-publish-service(1)
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy