Sponsored Content
Top Forums Shell Programming and Scripting Grep -q -F , what is the function of this script Post 303022803 by baris35 on Friday 7th of September 2018 12:32:50 PM
Old 09-07-2018
Dear Scott,
Thanks for your answer.
Aia mentioned or logic operator. I suppose what he implied is about below example:

Code:
$ false && echo howdy!

$ true && echo howdy!
howdy!
$ true || echo howdy!

$ false || echo howdy!
howdy!

I got the point clearly now.

Kind regards
Boris
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help in grep function or similar using awk

I have a list of id; for example: file 1 dfghd dfghe dfgey dfgeu I have another data file that contain this ids as headers; for ex. file2 >dfghd gfdgfddl;klfkld;ld;lgl;dld'l'dv >dfghe gkwhjhsgdjdjdjhjddj >dfgey jdkjfhdjhfdkjhfdkhkdk I wanted to compare file 1 and file 2... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

2. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

3. Shell Programming and Scripting

Perl - Grep function regular expression

For some reason, @logs is a list of log files @filter is a list of expressions to grep out foreach (@logs){ open READ, "<$_" or die $!; @temp=<READ>; close READ; foreach (@filter){ print grep /$_/,@temp ; } } returns a regex error in one of the files... (4 Replies)
Discussion started by: adelsin
4 Replies

4. UNIX Desktop Questions & Answers

grep function

Hi Guys, I have a very limited knowledge on shell scripting. When I execute dspmq, I get either " Running" or "Running in Standby" as output $dspmq QM1 Running QM2 Running as StandByI want my script to run only if the output of dspmq is "Running". I executed the below... (6 Replies)
Discussion started by: vandi
6 Replies

5. Shell Programming and Scripting

Cannot get grep to work within function.

Hello again, Am having an issue now with getting a simple grep command to work within a function.. The function is as below... function findRecord() { output=grep "001" recordDatabase echo $output } At the moment the "001"... (3 Replies)
Discussion started by: U_C_Dispatj
3 Replies

6. Shell Programming and Scripting

Help with grep and read function in a BASH Script

I'm putting together a script that will search my mail archives for emails that meet certain criteria and output the files to a text file. I can manually cat that text file and pipe it into sendmail and it will work (i.e. cat /pathtofile/foo.txt | sendmail -t me@company.com) My script sends... (7 Replies)
Discussion started by: binary-ninja
7 Replies

7. How to Post in the The UNIX and Linux Forums

GREP function in ksh which ignores LINE Breaks

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 this,... (3 Replies)
Discussion started by: Raghav Garg
3 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. Shell Programming and Scripting

What is the function of the following lines at the top of a shell script file: Directory and Script?

The file starts like this: Directory: <path to the script> Script: <script fife name> #!bin/ksh ##Comments <actual script> What is the use of the first two lines in the script? What if I save the file without them? What will be the effect? They are not comments. Im very new to this,... (4 Replies)
Discussion started by: remytom
4 Replies

10. Shell Programming and Scripting

Will files, creaetd in one function of the same script will be recognized in another function?

Dear All. I have a script, which process files one by one. In the script I have two functions. one sftp files to different server the other from existing file create file with different name. My question is: Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies
APC_INC(3)								 1								APC_INC(3)

apc_inc - Increase a stored number

SYNOPSIS
int apc_inc (string $key, [int $step = 1], [bool &$success]) DESCRIPTION
Increases a stored number. PARAMETERS
o $key - The key of the value being increased. o $step - The step, or value to increase. o $success - Optionally pass the success or fail boolean value to this referenced variable. RETURN VALUES
Returns the current value of $key's value on success, or FALSE on failure EXAMPLES
Example #1 apc_inc(3) example <?php echo "Let's do something with success", PHP_EOL; apc_store('anumber', 42); echo apc_fetch('anumber'), PHP_EOL; echo apc_inc('anumber'), PHP_EOL; echo apc_inc('anumber', 10), PHP_EOL; echo apc_inc('anumber', 10, $success), PHP_EOL; var_dump($success); echo "Now, let's fail", PHP_EOL, PHP_EOL; apc_store('astring', 'foo'); $ret = apc_inc('astring', 1, $fail); var_dump($ret); var_dump($fail); ?> The above example will output something similar to: 42 43 53 63 bool(true) Now, let's fail bool(false) bool(false) SEE ALSO
apc_dec(3). PHP Documentation Group APC_INC(3)
All times are GMT -4. The time now is 03:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy