Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Finding funny charaters in a string Post 302112923 by ahjaeasedqa on Monday 2nd of April 2007 02:05:10 AM
Old 04-02-2007
Mona,

Thanks for that. Could we include "/" as legitmate part of the string, as I am using full path name for the files.

Best regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Non-ASCII charaters in a unix file

Hi, Could you pls help me with the command to know the non-ascii characters in a unix file. Thanks (1 Reply)
Discussion started by: gaurav_gaba
1 Replies

2. UNIX for Dummies Questions & Answers

how to check a file to contain only ascii charaters

HI I need to validate a file in UNIX to contain only ascii characters.This is a production issue.Can anyone help with the command? Thanks Subbarao (1 Reply)
Discussion started by: srichakra9
1 Replies

3. Programming

inb(); not reading charaters as expected

I am sorry if this is in any way against the rules; the code isn't intended to be malicious, though it could be. If it is that bad, please delete/lock the thread instead of banning me. So, I'm creating a keylogger, and it's not working as expected. Currently the program reads directly into the... (13 Replies)
Discussion started by: Octal
13 Replies

4. Shell Programming and Scripting

help with finding a string

Hello folks I have a text file abcd.txt and has a line starting with number '8'. I have a string in this line starting at position 'a' to position 'b' also this string is a number and have to be reduced by 1. there is also a problem that it has to be padded with zeros to make the string... (2 Replies)
Discussion started by: sandyg
2 Replies

5. Shell Programming and Scripting

Problem with awk while handling special charaters

Hi, I have an application.xml file like </dependency> <artifactId>_AdminServicesEAR</artifactId> <version>1.0.0-20080521.085352-1</version> <context-root>oldvalue</context-root> <type>ear</type> <DOCTYPE "abc/xyz/eft"> <NewTag>value123</xyz> ... (4 Replies)
Discussion started by: subin_bala
4 Replies

6. Shell Programming and Scripting

printing positional charaters in a loop

#!/bin/bash usep=`df -hT | awk '{ print $5 }'` for (1=1,1<8,i++) output=`echo $usep | awk '{ print $i }'| cut -d'%' -f1` echo $output if then echo "critical value" i need to echo critical value if disk usage pecentage xceeds 10 and i am face problem in position marked red here i... (9 Replies)
Discussion started by: josgeorge
9 Replies

7. UNIX for Advanced & Expert Users

replace word with special charaters

I have input file called file1 with characters that have \\ in it. I cannot change input file, because it is generated earlier in script. Now would like to replace string on line in file called bfile with output from file1 I have been using sed command. $cat file1 pc//6sPxp== $ cat scr1... (4 Replies)
Discussion started by: drtabc
4 Replies

8. Shell Programming and Scripting

Finding a string with another string is found

finding a string with another string is found EX: abs c/- i want to find /-, then copy abs. i know it's easy use awk, but my problem is the substr syntax. substr($2,2,2) will give me /- but the conflict is /- is not always the second characted of the second string. (11 Replies)
Discussion started by: engr.jay
11 Replies

9. UNIX for Dummies Questions & Answers

Find and replace mulitple charaters in filenames

I have a virtual pdf printer set up on my server which produces files with the following prefix: smbprn_00000044_Microsoft_Word_-_OriginalFilename.pdfthe number in the center of the file increase by one for each new file. I want to remove all the charaters infront of OriginalFilename.pdf using... (14 Replies)
Discussion started by: barrydocks
14 Replies

10. Shell Programming and Scripting

Filter ONLY lines with non-printing charaters

I have a file contains data with non-printing characters. i have used cat -v filename to display whole data with non-printing characters also. However, i need lines with non-printing characters into seperate file. My file is huge and looks like i have to manully find lines using cat -v filename |... (3 Replies)
Discussion started by: JSKOBS
3 Replies
FORTUNE(6)							 BSD Games Manual							FORTUNE(6)

NAME
fortune -- print a random, hopefully interesting, adage SYNOPSIS
fortune [-aDefilosw] [-m pattern] [[N%] file/directory/all] DESCRIPTION
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is subdivided into those which are potentially offensive and those which are not. The options are as follows: -a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.) -D Enable additional debugging output. Specify this option multiple times for more verbose output. Only available if compiled with -DDEBUG. -e Consider all fortune files to be of equal size (see discussion below on multiple files). -f Print out the list of files which would be searched, but do not print a fortune. -l Long dictums only. -m pattern Print out all fortunes which match the regular expression pattern. See regex(3) for a description of patterns. -o Choose only from potentially offensive aphorisms. Please, please, please request a potentially offensive fortune if and only if you believe, deep down in your heart, that you are willing to be offended. (And that if you are not willing, you will just quit using -o rather than give us grief about it, okay?) ... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes" -s Short apothegms only. -i Ignore case for -m patterns. -w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe- cuted as part of the logout procedure to guarantee that the message can be read before the screen is cleared. The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number N between 0 and 100 inclu- sive, followed by a '%'. If it is, there will be an N percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes. As an example, given two databases funny and not-funny, with funny twice as big, saying fortune funny not-funny will get you fortunes out of funny two-thirds of the time. The command fortune 90% funny 10% not-funny will pick out 90% of its fortunes from funny (the ``10% not-funny'' is unnecessary, since 10% is all that is left). The -e option says to consider all files equal; thus fortune -e funny not-funny is equivalent to fortune 50% funny 50% not-funny ENVIRONMENT
FORTUNE_PATH The search path for the data files. It is a colon-separated list of directories in which fortune looks for data files. If not set it will default to /usr/share/games/fortune. If none of the directories specified exist, it will print a warning and exit. FORTUNE_SAVESTATE If set, fortune will save some state about what fortune it was up to on disk. FILES
/usr/games/fortune /usr/share/games/fortune/* the fortunes databases (those files ending ``-o'' contain the offensive fortunes) SEE ALSO
arc4random_uniform(3), regcomp(3), regex(3), strfile(8) BSD
November 7, 2007 BSD
All times are GMT -4. The time now is 08:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy