Sponsored Content
Full Discussion: Replacing tokens
Top Forums Shell Programming and Scripting Replacing tokens Post 302374728 by abhinav192 on Wednesday 25th of November 2009 09:36:05 AM
Old 11-25-2009
Hi tony,

The point is i want to get the replaced string in a variable
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tokens in unix ?

im trying to remove all occurences of " OF xyz " in a file where xyz could be any word assuming xyz is the last word on the line but I won't always be. at the moment I have sed 's/OF.*//' but I want a nicer solution which could be in pseudo code sed 's/OF.* (next token)//' Is... (6 Replies)
Discussion started by: seaten
6 Replies

2. Shell Programming and Scripting

reverse tokens with sed

I currently use this bash for loop below to reverse a set of tokens, example "abc def ghi" to "ghi def abc" but in looking at various sed one liner postings I notice two methods to reverse lines of text from a file (emulating tac) and reversing letters in a string (emulating rev) so I've spent some... (1 Reply)
Discussion started by: markc
1 Replies

3. Shell Programming and Scripting

: + : more tokens expected

Hello- Trying to add two numbers in a ksh shell scripts and i get this error every time I execute stat1_ex.ksh: + : more tokens expected stat1=`cat .stat1a.tmp | cut -f2 -d" "` stat2=`cat .stat2a.tmp | cut -f2 -d" "` j=$(($stat1 + $stat2)) # < Here a the like the errors out echo $j... (3 Replies)
Discussion started by: Nomaad
3 Replies

4. Shell Programming and Scripting

selecting tokens from a string...

i store the output of ls in a variable FL $FL=`ls` $echo $FL f1.txt f2.txt f3.txt f4.txt f5.txt script.sh script.sh~ test.txt now if i want to retrive the sub-string "f1.txt" from $FL we were taught that this is what i have to do $set $FL $echo $1 f1.txt and echo $2 would give... (1 Reply)
Discussion started by: c_d
1 Replies

5. Shell Programming and Scripting

Removing tokens from cmd line

Hi everyone. I am trying to develop my own shell,and i am in the part of redirection. let's say the user gives as input cat test > test2 in the array of arguments i want to keep only arg=cat,arg=test. ">" token is not an input file so cat cannot worka and test2 is output.how can i remove > and... (1 Reply)
Discussion started by: bashuser2
1 Replies

6. Programming

warning :extra tokens (ignored) after directive

hi I am getting the following warning while compilation of my C project. /var/tmp/aaaa003z6: warning: 101: extra tokens (ignored) after directive Can anyone help what this warning means and how to get rid of this. Thanks (1 Reply)
Discussion started by: pratim09
1 Replies

7. Shell Programming and Scripting

+: more tokens expected

Hey everyone, i needed some help with this one. We move into a new file system (which should be the same as the previous one, other than the name directory has changed) and the script worked fine in the old file system and not the new. I'm trying to add the results from one with another but i'm... (4 Replies)
Discussion started by: senormarquez
4 Replies

8. Shell Programming and Scripting

Need tokens in shell script

Hi All, Im writing a shell script in which I want to get the folder names in one folder to be used in for loop. I have used: packsName=$(cd ~/packs/Acquisitions; ls -l| awk '{print $9}') echo $packsName o/p: opt temp user1 user2 ie. Im getting the output as a string. But I want... (3 Replies)
Discussion started by: AB10
3 Replies

9. Shell Programming and Scripting

Count lines with similar tokens

I have 2 files, and I wish to count number of lines with this characteristic: if any token at line x in file1, is similar to a token at line x in file2. Here's an example: file1: ab, abc ef fg file2: ab cd ef gh In this case I wish to get 3. Note that token of file1 are... (3 Replies)
Discussion started by: Viernes
3 Replies

10. Programming

Reading tokens

I have a String class with a function that reads tokens using a delimiter. For example String sss = "6:8:12:16"; nfb = sss.nfields_b (':'); String tkb1 = sss.get_token_b (':'); String tkb2 = sss.get_token_b (':'); String tkb3 = sss.get_token_b (':'); String tkb4 =... (1 Reply)
Discussion started by: kristinu
1 Replies
ZAWAY(1)						      General Commands Manual							  ZAWAY(1)

NAME
zaway - tell other people via Zephyr that you aren't around SYNOPSIS
zaway [ OPTIONS ] [ FILE ] DESCRIPTION
zaway provides a way for you to automatically send replies when other people contact you using zwrite(1). zaway subscribes itself to class "MESSAGE", instance "*", so that it can monitor your incoming messages. It does not affect the operation of any other client receiving messages. zaway is typically run when you are leaving your terminal or display temporarily. zaway usually never exits; when you return to your terminal you should type the interrupt character (usually ^C) in order to make zaway exit. OPTIONS -m STRING Use STRING as the body of the auto-reply message. Any message file (specified on the command line or the default) is ignored. -w Watch the invoking user's location status. If the user is locatable anywhere, no auto-replies will be sent. -h Displays a short usage message and exits. zaway uses a message file (which defaults to $HOME/.away) to describe what reponses should be sent to which senders. The general format of this file is: >name >name message >name message Any number of user names may be specified preceding the message to send to those senders. If a user name appears more than once, the mes- sage will be a concatenation of each of the appropriate messages. There are two special names: "*" indicates that the following message should be sent to all senders and "%" indicates that the following message should only be sent if the user name has not matched yet. If no file is specified, and no default file can be found, the following message is returned: I'm sorry, but I am currently away from the terminal and am not able to receive your message. If a user name does not match any of those listed in the file, and no "*" or "%" field is specified, no return message is sent. All mes- sages are preceded by a signature "Automated reply:". To avoid loops, messages are not sent in response to messages beginning with an "Automated reply:" signature or sent by the same Kerberos principal as the user running zaway. SAMPLE FILE
>eichin >tony Hi there guys! I'm in the other room right now. I'll be back in 5 minutes or so. >jruser Sorry, but I'm gone for the day... >% Hello...I'm not sure who you are. I'll be back soon, though. >* This message comes to you compliments of zaway! The final "compliments" message will be included in all messages, whereas the "I'm not sure" message will only be included in messages that are not from "eichin", "tony", or "jruser". FILES
$HOME/.away SEE ALSO
zephyr(1), zwgc(1), zwrite(1), zhm(8), zephyrd(8) Project Athena Technical Plan Section E.4.1, `Zephyr Notification Service' AUTHOR
Robert S. French (MIT-Project Athena) RESTRICTIONS
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. All Rights Reserved. zephyr(1) specifies the terms and conditions for redistribution. MIT Project Athena July 1, 1988 ZAWAY(1)
All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy