Sponsored Content
Top Forums Shell Programming and Scripting Substring/Instring of a string with datestamp Post 302161318 by fpmurphy on Thursday 24th of January 2008 08:06:56 AM
Old 01-24-2008
An AWK solution

Code:
$ echo "JAN_BILS_PRINT_01-01-08.txt" | awk '{ printf("%s/%s/20%s", substr($0,16,2), substr($0,19,2), substr($0,22,2)) }'
01/01/2008
$

 

10 More Discussions You Might Find Interesting

1. Programming

can i get a substring from a string?

for example, the string a is "abcdefg", can i get a substring "bcd" (from ato a) from string a? thank you (4 Replies)
Discussion started by: dell9
4 Replies

2. Shell Programming and Scripting

getting a substring from a string

hi all, I am trying to extract SUBSTRINGS out of a string using ksh. The string is "SAPR3K.FD0.FA.TJ.B0010.T050302" I tried using a= `expr substr $stringZ 1 2` which is giving me a syntax error, donno why?? any ideas why its not working?? I also tried echo "welcome" | awk '{... (3 Replies)
Discussion started by: maradona
3 Replies

3. UNIX for Dummies Questions & Answers

How to get the substring from the string

Hi All, Can anybody help me to get the substring from the given string. (3 Replies)
Discussion started by: Anshu
3 Replies

4. Shell Programming and Scripting

get substring from string

Hi All, Problem Description: XML_REP_REQUEST=`CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME" "CP_SHORT_NAME"` echo Report Request: $XML_REP_REQUEST --to print value in log file While execution the value of 'XML_REP_REQUEST' is 'Prozess... (5 Replies)
Discussion started by: suman.g
5 Replies

5. Shell Programming and Scripting

Help with string and substring also I/O

#!/bin/sh PRINTF=/usr/bin/printf PASSWD=/etc/passwd $PRINTF "Enter a UserID\n" read USERID if ; then $PRINTF "$USERID does not exist, please contact IT service\n" exit 1 fi USERHOME=`grep "^$USERID:" $PASSWD | awk -F : '{print $6}'` USERSHELL=`grep "^$USERID:"... (1 Reply)
Discussion started by: ikeQ
1 Replies

6. Shell Programming and Scripting

Substring in string with whitespaces

hello, i have this string: variable="1234 /PARAMETER_1:text /PARAMETER_2:othertext" i tried to do expr match $variable '.*\(*\)' but i keep getting expr error i need to extract the word text... thank you (4 Replies)
Discussion started by: Aloush89
4 Replies

7. Shell Programming and Scripting

Instring in awk

Hi, I have the below data ownername/schemaname/tablename/columnname in a file ( 2nd column) I want to convert everthing to upper case except the column name like below OWNERNAME/SCHEMANAME/TABLENAME/columnname do we have a instring function in awk to handle this. Thx,shruthi (3 Replies)
Discussion started by: shruthidwh
3 Replies

8. Shell Programming and Scripting

How to extract a substring from a string

Hi, I have an input string say for example: ABC,DEF,IJK,LMN,...,XYZ The above string is comma delimited. Now I have to extract the last part after the comma i.e. XYZ. :b: (3 Replies)
Discussion started by: bghosh
3 Replies

9. UNIX for Dummies Questions & Answers

get substring from string variable

Hi Dears, How to use variable in string location of expression ${string:index:length} to get substring from string? I encounter error "bad substitution" when I use expression ${$var:0:5} to get first 5 characters from $var. Could you please help me out of this? Thanks! (2 Replies)
Discussion started by: crest.boy
2 Replies

10. Shell Programming and Scripting

Extracting substring within string between 2 token within the string

Hello. First best wishes for everybody. here is the input file ("$INPUT1") contents : BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY; BASH_FUNC_message_debug%%=() { local -a L_ARRAY; BASH_FUNC_message_end_script%%=() { local -a L_ARRAY; BASH_FUNC_message_error%%=() { local... (3 Replies)
Discussion started by: jcdole
3 Replies
AMFLUSH(8)						      System Manager's Manual							AMFLUSH(8)

NAME
amflush - flush Amanda backup files from holding disk to tape SYNOPSIS
amflush [ -f ] [ -D datestamp ]* config [ host [ disk ]* ]* DESCRIPTION
Amflush writes Amanda backups from the holding disks to tape, and updates the Amanda info database and tape list accordingly. Backups may stay in a holding disk when something is wrong with the tape at the time amdump is run. When this happens, the problem must be corrected and amflush run by hand. -D datestamp specify a datestamp expression you want to flush, see the "DATASTAMP EXPRESSION" section of amanda(8) for a description. -D 20001225-7 will flush all dump from 25 december 2000 to 27 december 2000. You can specify many host/disk expressions, only disks that match an expression will be flushed. All disk are flushed if no expression are given. see the "HOST & DISK EXPRESSION" section of amanda(8) for a description. Amflush will look in the holding disks specified by the amanda.conf file in /etc/amanda/config for any non-empty Amanda work directories. It then prompts you to select a directory or to process all of the directories. The work directories in the holding disks are named by the date at the time amdump was run, e.g. 19910215. Amflush normally detaches itself from the tty and runs as a background process. With the -f option, amflush stays in the foreground. This is useful if amflush is run as part of another script that, for example, advances the tape after the flush is completed. See the amanda(8) man page for more details about Amanda. EXAMPLE
Amflush will search for holding areas associated with the PUCC configuration. After you select which holding area to flush, amflush writes the data to tape, updates the databases and sends a mail report similar to amdump(8). % amflush DailySet1 Scanning /amanda-hold... 20001113: found Amanda directory. 20001114: found Amanda directory. Multiple Amanda directories, please pick one by letter: A. 20001113 B. 20001114 Select directories to flush [A..B]: [ALL] all Flushing dumps in 20001113, 20001114, today: 20001117 to tape drive /dev/rmt/0mn. Expecting tape DMP014 or a new tape. (The last dumps were to tape DMP013) Are you sure you want to do this? yes Running in background, you can log off now. You'll get mail when amflush is finished. AUTHOR
James da Silva <jds@cs.umd.edu> University of Maryland, College Park SEE ALSO
amanda(8), amdump(8) AMFLUSH(8)
All times are GMT -4. The time now is 03:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy