Sponsored Content
Top Forums Shell Programming and Scripting filename manipulation using "sed" Post 302546343 by itkamaraj on Thursday 11th of August 2011 03:32:08 AM
Old 08-11-2011
what you exactly doing with the file name ?

please explain your problem clearly. after manipulating the file, what command you are trying to run ?

Code:
for i in dump.*; do new_value=$(echo "$i" | sed 's/dump/newname/'); echo $new_value; done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

2. UNIX for Dummies Questions & Answers

the meaning of "!:*" in "alias foo 'command\!:*' filename"

Hi: How can I remove my own post? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

3. Shell Programming and Scripting

Simplify Bash Script Using "sed" Or "awk"

Input file: 2 aux003.net3.com error12 6 awn0117.net1.com error13 84 aux008 error14 29 aux001.ha.ux.isd.com error12 209 aux002.vm.ux.isd.com error34 21 alx0027.vm.net2.com error12 227 dux001.net5.com error123 22 us008.dot.net2.com error121 13 us009.net2.com error129Expected Output: 2... (4 Replies)
Discussion started by: sQew
4 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

"tail -n 1 filename" error while "head -n 1 filename" is ok?

Hi all, I was wondering why tail -n 2 filename produce an error when I manage to do similar command on head -n 2 filename SunOS{type8code0}: tail -n 2 filename usage: tail ] tail ] (2 Replies)
Discussion started by: type8code0
2 Replies

6. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

7. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

8. Post Here to Contact Site Administrators and Moderators

Suggestion: adding two new groups "sed" and "awk"

Majority of the questions are pertaining file/string parsing w.r.t sed or awk It would be nice to have these two as their own sub category under shell-programming-scripting which can avoid lot of duplicate posts. (1 Reply)
Discussion started by: jville
1 Replies

9. Shell Programming and Scripting

Awk,sed : change every 2nd field ":" to "|"

Hi Experts, I have a string with colon delimited, want 2nd colon to be changed to a pipe. data: 101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3: I am trying with sed, but can change only 1 occurance: echo "101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3:" | sed 's/:/|/2'... (5 Replies)
Discussion started by: rveri
5 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
WebKDC::Token(3pm)					User Contributed Perl Documentation					WebKDC::Token(3pm)

NAME
WebKDC::Token - token objects for use with WebAuth SYNOPSIS
use WebKDC::Token; # includes WebKDC::{App,Id,Proxy,Request,Response,Service}Token # manually create a new token, and then encode/encrypt it my $id_token = new WebKDC::IdToken; $id_token->subject_auth('krb5'); $id_token->subject_auth_data($sad); $id_token->creation_time(time()); $id_token->expiration_time($et); my $id_token_str = bas64_encode($id_token->to_token($key)); # parse an encrypted/encoded token, given the encrypted/encoded token, # the keyring used to encrypt it, and an optional time to live. If the # TTL is not zero, the token is treated as invalid if its creation time is # more than ttl ago (this is not needed if the token had an expiration # time set when it was created). my $req_token = new WebKDC::RequestToken($req_token_str, $key, $ttl); DESCRIPTION
WebKDC::Token is the base class for all the Token objects, which are available upon using WebKDC::Token: WebKDC::AppToken WebKDC::IdToken WebKDC::ProxyToken WebKDC::RequestToken WebKDC::ErrorToken WebKDC::CredToken WebKDC::WebKDCProxyToken WebKDC::WebKDCServiceToken It contains the functions that are common across all the token objects, as well as some functions that must be overridden in the subclasses. EXPORT
None METHODS
to_token(key_or_keyring) $binary_token = $token->to_token($key_or_keyring); Takes a token object and encrypts/encodes it into a binary string. WebAuth::base64_encode should be used if the token needs to base64 encoded. to_string() $str = $token->to_string(); used mainly for debugging to get a dump of all the attributes in a token. The Token object all overloads '""', so calling this function is optional, you can just use a token object as a string to get the same result. new $token = new WebKDC::SubclassToken; $token = new WebKDC::SubclassToken($binary_token, $key_or_ring, $ttl); The new constructor for tokcns is used to create a token object. The first form is used to construct new tokens, while the second form is used to parse a binary token into a token object. Note, only subclasses of Token should be constructed using new. To parse an unknown token, use the parse class method. parse $token = WebKDC::Token::parse($binary_token, $key_or_ring, $ttl); Used to create a from a binary token when you don't know ahead of time what the resulting token type will be. The type of the returened token can be checked with token_type() or the UNIVERSAL isa method. validate_token This method should be overridden by subclasses. It is used to validate that a particular token contains the correct attributes. It gets called by the to_token method before the token is encoded, and by the constructor with args after a token has been parsed. init This method should be ovveridden by subclasses and is used to initialize a token when the constructor with no args is called. token_type([$new_value]) $token->token_type($new_value); $type = $token->token_type(); The first form is used to set the token type, the second form is used to get the token type. WebKDC::AppToken The WebKDC::AppToken object is used to represent WebAuth app-tokens. $token = new WebKDC::AppToken; $token = new WebKDC::AppToken($binary_token, $key_or_ring, $ttl); $token->app_data($name[, $new_value]) $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->lastused_time([$lastused_time]) $token->subject([$new_value]) $token->session_key([$new_value]) $token->initial_factors([$new_value, ...]) $token->session_factors([$new_value, ...]) $token->loa([$new_value]) WebKDC::CredToken The WebKDC::CredToken object is used to represent WebAuth cred-tokens. $token = new WebKDC::CredToken; $token = new WebKDC::CredToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->cred_type([$new_value]) $token->cred_subject([$new_value]) $token->cred_data([$new_value]) $token->subject([$new_value]) WebKDC::IdToken The WebKDC::IdToken object is used to represent WebAuth id-tokens. $token = new WebKDC::IdToken; $token = new WebKDC::IdToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->subject([$new_value]) $token->subject_auth([$new_value]) $token->subject_auth_data([$new_value]) $token->initial_factors([$new_value, ...]) $token->session_factors([$new_value, ...]) $token->loa([$new_value]) WebKDC::LoginToken The WebKDC::LoginToken object is used to represent WebAuth login-tokens. $token = new WebKDC::LoginToken; $token = new WebKDC::LoginToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->password([$new_value]) $token->otp([$new_value]) $token->username([$new_value]) WebKDC::ProxyToken The WebKDC::ProxyToken object is used to represent WebAuth proxy-tokens. $token = new WebKDC::ProxyToken; $token = new WebKDC::ProxyToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->proxy_type([$new_value]) $token->subject([$new_value]) $token->webkdc_token([$new_value]) $token->initial_factors([$new_value, ...]) $token->session_factors([$new_value, ...]) $token->loa([$new_value]) WebKDC::RequestToken The WebKDC::RequestToken object is used to represent WebAuth request-tokens. $token = new WebKDC::RequestToken; $token = new WebKDC::RequestToken($binary_token, $key_or_ring, $ttl); $token->app_state([$new_value]) $token->creation_time([$new_value]) $token->proxy_type([$new_value]) $token->request_options([$new_value]) $token->requested_token_type([$new_value]) $token->return_url([$new_value]) $token->subject_auth([$new_value]) $token->initial_factors([$new_value, ...]) $token->session_factors([$new_value, ...]) $token->loa([$new_value]) WebKDC::ErrorToken The WebKDC::ErrorToken object is used to represent WebAuth error-tokens. $token = new WebKDC::ErrorToken; $token = new WebKDC::ErrorToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->error_code([$new_value]) $token->error_message([$new_value]) WebKDC::WebKDCProxyToken The WebKDC::WebKDCProxyToken object is used to represent WebAuth webkdc-proxy-tokens. $token = new WebKDC::WebKDCProxyToken; $token = new WebKDC::WebKDCProxyToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->proxy_data([$new_value]) $token->proxy_subject([$new_value]) $token->proxy_type([$new_value]) $token->subject([$new_value]) $token->initial_factors([$new_value, ...]) $token->loa([$new_value]) WebKDC::WebKDCServiceToken The WebKDC::WebKDCServiceToken object is used to represent WebAuth webkdc-service-tokens. $token = new WebKDC::WebKDCServiceToken; $token = new WebKDC::WebKDCServiceToken($binary_token, $key_or_ring, $ttl); $token->creation_time([$new_value]) $token->expiration_time([$new_value]) $token->subject([$new_value]) $token->session_key([$new_value]) AUTHOR
Roland Schemers (schemers@stanford.edu) SEE ALSO
WebAuth. perl v5.14.2 2012-04-25 WebKDC::Token(3pm)
All times are GMT -4. The time now is 03:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy