UNIX Shell Script to Remove MongoDB Document-Based on Many inputs
Here I am in a position to write a Unix Shell script(.sh) to remove MongoDB collection documents. I know how to remove based on a condition like below and it works for me.
But I need to change the remove statement based on a new parameter ,lets say PID which will receive bunch of inputs(Many PID's).
I don't need to remove the collection based on the Timestamp field ,Instead my condition has to be changed as per my previous statement.
I went through many forums ,But I am not able to get the solution.
Please help me to resolve this in my UNIX shell script.
Sample Data:-
My Collection have an attribute called PID as shown above ,like Timestamp.Where we will store integer kind of values like 1233,1456,4566..etc .So I require to remove documents who has PID as 1233,1456 in my batch dynamically
Last edited by senthilmadhanT; 12-31-2019 at 01:32 AM..
Hi All,
I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Hi,
Lets say I have a script "ss" which does this
read abc
echo $abc
read pqr
echo $pqr
Now if I want to pass and argument to only "abc" how do I do it.
If I do
echo "somevalue" | ss, it does not prompt for pqr and its value comes out as blank.
Any help is appreciated
Thanks
P (6 Replies)
Hi UNIX Gurus,
I have a SQL utility which fires DML statements against DB2 tables. Logic is to identify DML statements, put it into a file ($dml) and execute the job.
DML file can have more than 1 DML statements....but all of 1 type at a time.....either all UPDATE or all DELETE.
Job first... (2 Replies)
Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help.
Thanks.:) (8 Replies)
Hi,
I am using solari 10 OS which is having bash shell.
I need a shell script which takes user home directory and name of the file or directory as a input and based on that copy the files accordingly to the other directory.
example:I hava a machine1 which is having some files in a... (8 Replies)
Hi,
I am using solaris 10 bash shell.this might a small script but i am not much familiar with scripting.
My requirement here is script should prompt for users two opions like this
"please select either any one option makefile or make& build file".
if the user selects make file option... (2 Replies)
Got struck while trying to write a shell script which should automatically give input.
While running a script for eg: (adpatch.sh)
It Prompts for Multiple inputs like:
Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP ? need to give... (2 Replies)
Hi,
I have a shell script to install one of our products. It comprises of commands that are specific to the product installation. These commands require user inputs at different stages.
To avoid manual feeding of inputs every time, I tried using HERE document.
it is like-
#! /usr/bin
... (1 Reply)
Hi
I am trying to pass 2 input parameters from shell script to python API end point ,but not passing what i expected when print those inputs .Please advise
data.txt
" 7554317" ,xx5e1
" 7554317" ,xx96
" 7554317" ,xxd6
" 554317" ,xde
cat $sites/data.txt |sort |uniq >$sites/a.txt... (5 Replies)
Discussion started by: akil
5 Replies
LEARN ABOUT DEBIAN
dpid.h
dpid.h(3) libdaemon dpid.h(3)NAME
dpid.h -
Contains an API for manipulating PID files.
SYNOPSIS
#include <sys/types.h>
Defines
#define DAEMON_PID_FILE_KILL_WAIT_AVAILABLE 1
This variable is defined to 1 iff daemon_pid_file_kill_wait() is supported.
Typedefs
typedef const char *(* daemon_pid_file_proc_t )(void)
Prototype of a function for generating the name of a PID file.
Functions
const char * daemon_pid_file_proc_default (void)
A function for creating a pid file name from daemon_pid_file_ident.
int daemon_pid_file_create (void)
Creates PID pid file for the current process.
int daemon_pid_file_remove (void)
Removes the PID file of the current process.
pid_t daemon_pid_file_is_running (void)
Returns the PID file of a running daemon, if available.
int daemon_pid_file_kill (int s)
Kills a running daemon, if available.
int daemon_pid_file_kill_wait (int s, int m)
Similar to daemon_pid_file_kill() but waits until the process died.
Variables
const char * daemon_pid_file_ident
Identification string for the PID file name, only used when daemon_pid_file_proc is set to daemon_pid_file_proc_default().
daemon_pid_file_proc_t daemon_pid_file_proc
A function pointer which is used to generate the name of the PID file to manipulate.
Detailed Description
Contains an API for manipulating PID files.
Definition in file dpid.h.
Define Documentation
#define DAEMON_PID_FILE_KILL_WAIT_AVAILABLE 1
This variable is defined to 1 iff daemon_pid_file_kill_wait() is supported. Since:
0.3
See also:
daemon_pid_file_kill_wait()
Definition at line 82 of file dpid.h.
Typedef Documentation
typedef const char*(* daemon_pid_file_proc_t)(void)
Prototype of a function for generating the name of a PID file.
Definition at line 37 of file dpid.h.
Function Documentation
int daemon_pid_file_create (void)
Creates PID pid file for the current process. Returns:
zero on success, nonzero on failure
Examples:
testd.c.
pid_t daemon_pid_file_is_running (void)
Returns the PID file of a running daemon, if available. Returns:
The PID or negative on failure
Examples:
testd.c.
int daemon_pid_file_kill (int s)
Kills a running daemon, if available. Parameters:
s The signal to send
Returns:
zero on success, nonzero on failure
int daemon_pid_file_kill_wait (int s, int m)
Similar to daemon_pid_file_kill() but waits until the process died. This functions is new in libdaemon 0.3. The macro
DAEMON_PID_FILE_KILL_WAIT_AVAILABLE is defined iff libdaemon supports this function.
Parameters:
s The signal to send
m Seconds to wait at maximum
Returns:
zero on success, nonzero on failure (timeout condition is considered a failure)
Since:
0.3
See also:
DAEMON_PID_FILE_KILL_WAIT_AVAILABLE
Examples:
testd.c.
const char* daemon_pid_file_proc_default (void)
A function for creating a pid file name from daemon_pid_file_ident. Returns:
The PID file path
int daemon_pid_file_remove (void)
Removes the PID file of the current process. Returns:
zero on success, nonzero on failure
Examples:
testd.c.
Variable Documentation
const char* daemon_pid_file_ident
Identification string for the PID file name, only used when daemon_pid_file_proc is set to daemon_pid_file_proc_default(). Use
daemon_ident_from_argv0() to generate an identification string from argv[0]
Examples:
testd.c.
daemon_pid_file_proc_t daemon_pid_file_proc
A function pointer which is used to generate the name of the PID file to manipulate. Points to daemon_pid_file_proc_default() by default.
Author
Generated automatically by Doxygen for libdaemon from the source code.
Version 0.14 17 Jan 2010 dpid.h(3)