Sponsored Content
Top Forums Shell Programming and Scripting Regex within IF statement in awk Post 302806307 by Ophiuchus on Monday 13th of May 2013 12:31:59 AM
Old 05-13-2013
Hello hanson and alister,

Many thanks for your time to try to help. And thanks for your explanations, I have more clear some things.

hanson,

I was tried too, use double escaping but I had the semicolon in the same place either Smilie.

Alister,

May you explain me please, why that misplaces semicolon generates an empty if-statement.

When I need to put semicolon (when is mandatory and when is not)?

In this case, the semicolon was actually ruining the output.

Thanks for all the help.

Last edited by Ophiuchus; 05-13-2013 at 01:39 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Regex in if-then-else statement to match strings

hello I want to do a pattern match for string in the if statement, but I am not sure how to use regex inside the if statement. I am looking for something like this: if {2,3} ]; then ..... .... ... fi (7 Replies)
Discussion started by: rakeshou
7 Replies

2. Shell Programming and Scripting

awk or regex

Hi! I want to made a program that will generate code like this: {{Navedi XYZ |avtor=XYZ1 |naslov=XYZ2 |leto_izzida=XYZ3 |zalozba=XYZ4 |kraj=XYZ5 |isbn=XYZ6 |cobiss_id=XYZ7 }} from input like this: <b> ODGOVORNOST............. : <a... (5 Replies)
Discussion started by: smihael
5 Replies

3. Shell Programming and Scripting

[BASH] recognise new line regex in case statement

Hi, I'm trying to write a routine to parse a file that contains data that will be read into arrays. The file is composed of labels to identify data types and arbitrary lines of data with the usual remarks and empty new lines as is common with config files. The initial pass is built as so:... (3 Replies)
Discussion started by: ASGR
3 Replies

4. Shell Programming and Scripting

awk regex problem

hi everyone suppose my input file is ABC-12345 ABCD-12345 BCD-123456 i want to search the specific pattern which looks like - in a file so i used this command cat $file | awk ' { if ($0 ~ /-/) { print } }' so it gives me the result as ABCD-12345 BCD-12345 BCD-12345 ... (31 Replies)
Discussion started by: aishsimplesweet
31 Replies

5. UNIX for Dummies Questions & Answers

Using AWK and regex

Hi can you suggest in this regard The sample.txt conatins the data name lines type sam 12 txt sam 24 xls sam 36 pdf ram 32 txt ram 45 sxls ram 58 word sam 92 jpeg sam 21 gif sam 22 ltf from the data i need to sum all line... (5 Replies)
Discussion started by: krashraj
5 Replies

6. Shell Programming and Scripting

awk equivalent of regex

Hi all, Can someone tell me what's the (g)awk equal of this simple regex to find ip addresses in urls: egrep "^http://{1,3}\.{1,3}\.{1,3}\.{1,3}(:{1,5})?/"Input: http://10.0.0.1/query.exe http://11y10x09w:80/howaboutme http://192.168.100.190:1234/takeme.gpg Output:... (8 Replies)
Discussion started by: r4v3n
8 Replies

7. Shell Programming and Scripting

Regex escape special character in AWK if statement

I am having issues escaping special characters in my AWK script as follows: for id in `cat file` do grep $id in file2 | awk '\ BEGIN {var=""} \ { if ( /stringwith+'|'+'50'chars/ ) { echo "do this" } else if ( /anotherString/ ) { echo "do that" } else { ... (4 Replies)
Discussion started by: purebc
4 Replies

8. Shell Programming and Scripting

If statement with [[ ]] and regex not working as expected

Using BASH: $ if -- ::00" ]]; then echo "true"; else echo "false"; fi false Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies

9. Shell Programming and Scripting

Perl - what does this statement mean -Regex

push @MACARRAY, "$+{catalog} $+{machine}\n" if ($info =~ /(?<catalog>catalog).+?(?<machine>\*+)/ms); I am (still) trying to solve problem. Looking around on the server I found this piece of code. Specifically what does "$+{catalog} $+{machine}\n" do ? Thanks in advance (1 Reply)
Discussion started by: popeye
1 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
VMSBACKUP(1)						      General Commands Manual						      VMSBACKUP(1)

NAME
vmsbackup - read a VMS backup tape SYNOPSIS
vmsbackup -{tx}[cdenvw][s setnumber][f tapefile] [ name ... ] DESCRIPTION
vmsbackup reads a VMS generated backup tape, converting the files to Unix format and writing the files to disc. The default operation of the program is to go through an entire tape, extracting every file and writing it to disc. This may be modified by the following options. c Use complete filenames, including the version number. A colon and the octal version number will be appended to all filenames. A colon, rather than a semicolon, is used since the Unix Shell uses the semicolon as the line separator. Using a colon prevents the user from having to escape the semicolon when referencing the filename. This option is useful only when multiple versions of the same file are on a single tape or when a file of the same name already exists in the destination directory. The default is to ignore version numbers. d use the directory structure from VMS, the default value is off. e Process all filename extensions. Since this program is mainly intended to move source code and possibly data from a DEC system to a Unix system, the default is to ignore all files whose filename extension specifies system dependent data. The file types which will be ignored, unless the e option is specified, are exe VMS executable file lib VMS object library file obj RSX object file odl RSX overlay description file olb RSX object library file pmd RSX post mortem dump file stb RSX task symbol table file sys RSX bootable system file tsk RSX executable task file f Use the next argument in the command line as the tape device to be used, rather than the default. If vmsbackup is compiled with the remote tape option and the file name has the form system[.user]:/dev/??? vmsbackup will use the tape drive /dev/??? on the remote system system, via rsh(1), and rmt(8). The optional user portion of the pathname specifies the login name to use on the remote system. If it is not supplied, the current user's login name will be used. In all the cases, the user must have the appropriate permissions on the remote machine, in order to use this facility. The default is /dev/rmt8 (drive 0, raw mode, 1600 bpi). This must be a raw mode tape device. n If the tape has a variable-length record format, then do not append a newline onto the end of the records. This option does not affect stream or FORTRAN files. s saveset Process only the given saveset number. t Produce a table of contents (a directory listing) on the standard output of the files on tape. v Verbose output. Normally vmsbackup does its work silently. The verbose option will cause the filenames of the files being read from tape to disk to be output on the standard output. w vmsbackup prints the action to be taken followed by file name, then wait for user confirmation. If a word beginning with `y' is given, the action is done. Any other input means don't do it. x extract the named files from the tape. The optional name argument specifies one or more filenames to be searched for specifically on the tape and only those files are to be processed. The name may contain the usal sh(1) meta-characters *?![] 0n. FILES
/dev/rmtx SEE ALSO
rmtops(3) BUGS
The filename match uses the complete VMS file names. AUTHOR
John Douglas Carey Sven-Ove Westberg VMSBACKUP(1)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy