Sponsored Content
Contact Us Post Here to Contact Site Administrators and Moderators How to Post in the The UNIX and Linux Forums GREP function in ksh which ignores LINE Breaks Post 302917983 by Raghav Garg on Friday 19th of September 2014 04:05:56 PM
Old 09-19-2014
I just need the file name having both of these patterns but line break is posing a problem I believe.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep a number from a line in ksh

In file.name, I have a line that reads $IDIR/imgen -usemonths -dropcheck -monitor -sizelimit 80000000 -interval 120 -volcal HSI How can I get the size limit, i.e. 80000000 out and pass it to a variable called SIZE? Thanks. I tried echo "grep sizelimit file.name" | sed -n -e... (3 Replies)
Discussion started by: rodluo
3 Replies

2. Shell Programming and Scripting

any better way to remove line breaks

Hi, I got some log files which print the whole xml message in separate lines: e.g. 2008-10-01 14:21:44,561 INFO do something 2008-10-01 14:21:44,561 INFO print xml : <?xml version="1.0" encoding="UTF-8"?> <a> <b>my data</b> </a> 2008-10-01 14:21:44,563 INFO do something again I want... (3 Replies)
Discussion started by: csmklee
3 Replies

3. Shell Programming and Scripting

Help with wc and line breaks

Hi everyone, I have gone through the forum trying to find an answer to this question but was unsuccessful. I am hoping that someone can help me with this please. I am trying to get my script to recognise line breaks from a file and to give me a result for wc of each line. So basically, if you... (7 Replies)
Discussion started by: stargazerr
7 Replies

4. Shell Programming and Scripting

While read line ignores the '\' in file content

I need to read temp.$i file content line by line through while loop but somehow the '\' do not appear in output.. Can someone guide how to read this exact content line by line in unix : if then cat temp.$i | head -1 # the file content appears fine while... (13 Replies)
Discussion started by: Prev
13 Replies

5. Programming

Clean and keep line breaks

Hello, I want to keep line spaces in comments but clean more then 2 after each. Example: $sentence="This is my first sentence This will be in a new row This will be too in a new row but not separated with 3line breaks just with one "; And i want to... (1 Reply)
Discussion started by: AimyThomas
1 Replies

6. Shell Programming and Scripting

ksh while read loop breaks after one record - AIX

#!/bin/ksh for SRV in imawasp01 \ imawasp02 \ imawasp03 \ imawasp04 \ imawasp05 \ imawasp06 \ imawasp07 \ imawasp08 \ imawasp09 do print "${SRV}" while read PASSLINE do SRVNAME=`echo ${PASSLINE} | awk -F\: '{print $1}'` LASTLOGIN=`ssh ${SRV} lsuser ${SRVNAME} | tr '... (2 Replies)
Discussion started by: port43
2 Replies

7. UNIX for Dummies Questions & Answers

Page breaks and line breaks

Hi All, Need an urgent solution to an issue . We have created a ksh file or shell script which generates 1 DAT file. the DAT file contains extract of a select statement . Now the issue is , when we are executing the ksh file , the output is coimng with page breaks and line breaks . We have... (4 Replies)
Discussion started by: Ayaskant
4 Replies

8. UNIX for Dummies Questions & Answers

GREP function in ksh which ignores LINE Breaks

Hello I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command grep -l 'RITE AID.*ST.820' natriter820u.20140914 Pattern1 - RITE AID Pattern2 - ST*820 I am not getting any results from... (24 Replies)
Discussion started by: Raghav Garg
24 Replies

9. HP-UX

After using @, line breaks for a particular user in shell

Dear Concern, When we using @ sign, line breaks for a particular user in shell. Please advise how to resolve from the problem in HP UX. tabs@tabsdb02:/ccbs/users/tabs$ cat /etc/passwd|grep tabs tabs:RdCgOsmKee7Ps:221:201::/ccbs/users/tabs:/usr/bin/ksh... (3 Replies)
Discussion started by: makauser
3 Replies

10. Shell Programming and Scripting

[BASH] read 'line' issue with leading tabs and virtual line breaks

Heyas I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter). The typewriter-part is a 'bonus' but still has its own flaws, but thats for later. So in some way, i'm trying to rewrite cat using bash and other commands. But sadly it fails on... (2 Replies)
Discussion started by: sea
2 Replies
brag(1) 						      General Commands Manual							   brag(1)

NAME
brag - Grab multipart binaries from news server SYNOPSIS
brag [-s server] [-P port] [-g group] [-l user] [-p pass] [-q] [-u] [-o dir] [-n num] [-c] [-C] [-X] [-a pattern [-a pattern] ...] [-r pattern [-r pattern] ...] [-A file] [-R file] [-t n] [-b break] [-m max] or brag -L [-s server] [-P port] [-l user] [-p pass] DESCRIPTION
brag downloads and assembles multipart binaries from an NNTP server. Attachments encoded with uuencode, Base64 or yenc are supported. OPTIONS -L Just print a list of groups available at the server -s server Set news server to server -P port Set TCP port to port -g group Set newsgroup to group -l user Set user name to user. Setting this option turns NNTP authentication on. The password can be specified using the -p command line option, or using a passwod file (see later) -p pass Set password to pass. -q Be silent: do not display progress information -u Save subjects together with the assembled binaries. Subject files have the same name as the binary, with .sub extension added -k Keep original file names when possible, only rename when necessary to avoid a collission with existing files -o dir Set output directory to dir -n num Start with message number num -c Combine parts, even if they are from different newsgroups. Also, an article will be downloaded only once, even if it was crossposted to more than one newsgroups -C Combine parts, even if they are from different news servers -X Process single-part messages, too -a pattern Add pattern to the list of accept patterns. See next section on accept/reject patterns -r pattern Add pattern to the list of reject patterns -A file Read accept patterns from this file -R file Read reject patterns from this file -t n Use n number of parallel connections to the server. Default: 2. Set to 4 or more if you have a high speed network connection -b break Specify "break factor": the number of milliseconds to wait between retrieving lines from the server. Useful to share a low-speed connection with other applications -m max Specify the maximum number of messages to download ACCEPT AND REJECT PATTERNS
The subjects of the messages to be downloaded are matched against the list of accept and/or reject patterns if specified on the command line or in the accept/reject files (see later). Only articles matching at least one of the accept patterns will be accepted. Similarly, articles matching one of the reject patterns will be rejected. Match operations are performed as in csh(1). For example, to accept all files with extension mp5 , specify -a '*.mp5*' on the command line. Note the quotes (we do not want the shell to process the pattern) and the second "*" (we are matching against subject lines, not file names). FILES
DOWNLOADED FILES Grabbed files are collected in ~/.brag/<server>/<group>/finished (if not specified otherwise using the -o command line option). If combin- ing parts from multiple servers ("-C" option), the results are collected in ~/.brag/all-servers/<group>/finished. WORK FILES Work files are kept in ~/.brag/<server>/<group>/unfinished or in ~/.brag/all-servers/<group>/unfinished if the "-C" option is used. It is recommended to regularly purge these directories by removing old files and subdirectories. What "old" means depends on the newsgroup's traffic; one week can be a good approximation. PASSWORD FILES Passwords can be specified on the command line, or for extra security, in password files. Each server can have its own password file, named ~/.brag/<server>/passwd. The format of these files is: user1:password1 user2:password2 ... Passwords are not encoded. Take care of the file ownership and permissions. ACCEPT AND REJECT FILES If a file called accept is present in ~/.brag/<server>/<group>, its lines are added to the list of accept patterns. Empty ones and comments starting with "#" are ignored. Similarly, the contents of the file named reject will be added to the list of reject patterns. EXIT CODES
0 Success 1 Usage errors 2 Network errors 3 File system errors ENVIRONMENT
If not specified on the command line, the environment variable NNTPSERVER identifies the server, while NNTPGROUP the group to read the news from. DEPENDENCIES
brag is written in Tcl; you need tclsh(1) version 8.0 or later. For the actual decoding of dowloaded parts uudeview(1) (http://www.fpx.de/fp/Software/UUDeview) is used. AUTHOR
Akos Polster (akos@pipacs.com) and many others - see README for the complete list of contributors. brag(1)
All times are GMT -4. The time now is 11:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy