I'm trying to make a simple search script but cannot get it right. The script should search for keywords inside files. Then return the file paths in a variable. (Each file path separated with \n).
#!/bin/bash
SEARCHQUERY="searchword1 searchword2 searchword3";
for WORD in $SEARCHQUERY
do
... (6 Replies)
Hi,
I confess to be stuck ...
as explained here
Aliases - Bash Reference Manual
I added
shopt -s expand_aliasesto my script ... but it didn't work.
Later I've read I had to add this at the begning of my my script :
. ~/.bash_aliases(of course my aliases are in this file)
but again, the... (0 Replies)
I'm tring to write down a simple script that would execute a command and wait until it returns a specific result.
This is what i did:
bjobs_out=`bjobs`
while ]; do
bjobs_out=`bjobs`
sleep 6
done
It seems to work until the command 'jobs' return the list of jobs in execution, but... (4 Replies)
Hi,
I am very new to bash scripting and I need to write a bash script that takes two arguments, a string and a file. The output should be each line which matches the string *from the beginning of the line*. For example, given a string "ANA" the line starting with "ANABEL" will be printed, but... (9 Replies)
hi guys
i have this very messy script, that looks in /var/log/messages.all for an error and reports if it finds the key works
how can i get it to look at more then one file, i.e /var/log/message.all *
so it looks in old logs as well
thanks
exit 0 if (isRenderNode(hostname));
my... (4 Replies)
When it comes to programing and UNIX, I know just enough to be really really dangerous.
I have written a python script to parse through a file that contains ~1 million lines. Depending on whether a certain string is matched, the line is copied into a particular file. For the sake of brevity,... (4 Replies)
Hello,
I am writing a script that has to log in to X number of servers over a full C class range.
I am only keyed on a certain number of these servers and this can change from time to time.
The part of my script that deals with this is
for i in $(cat $server_list); do
ssh ... (0 Replies)
Hi,
I'm having trouble with a script to copy one line out of multiple files in a directory and copy to a file called test. I've tried the code below but it copies one line out of the first file multiple times not one line out of all the files. Would someone help? I'm very new to all this.
... (8 Replies)
Hi,
I am trying to run a python script embedded in bash script. But is throwing me an error. Please help.
Script:
#!/bin/bash
nohup /usr/bin/python /opt/web/http.py &
Error:
/usr/bin/python: can't open file '/opt/web/http.py': No such file or directory
Please help me on this. (6 Replies)
Dear all,
Please help with the following.
I have a file, let's call it data.txt, that has 3 columns and approx 700,000 lines, and looks like this:
rs1234 A C
rs1236 T G
rs2345 G T
Please use code tags as required by forum rules!
I have a second file, called reference.txt,... (1 Reply)
Discussion started by: aberg
1 Replies
LEARN ABOUT OPENDARWIN
nifind
NIFIND(1) General Commands Manual NIFIND(1)NAME
nifind - find a directory in the NetInfo hierarchy
SYNOPSIS
nifind [ -anvp ] [ -t timeout ] directory [ domain ]
DESCRIPTION
nifind searches for the named directory in the NetInfo hierarchy. It starts at the local domain and climbs up through the hierarchy until
it reaches the root domain. Any occurrences of directory are reported by directory ID number. If the optional domain argument is given,
then nifind stops climbing at that point in the hierarchy. The domain argument must be specified by an absolute or relative domain name.
When invoked with the -a option, nifind searches for the named directory in the entire NetInfo hierarchy (or the subtree with domain as the
root if domain is specified). The -n option exempts local domains from the search.
nifind uses a default two second connection timeout when contacting a domain. The connection timeout can be overridden with the -t option.
OPTIONS -a Search for directory in the entire NetInfo hierarchy.
-n Exempt local directories from the search.
-p Print directory contents.
-t timeout
Specify an integer value as the connection timeout (in seconds).
-v Produce verbose output.
EXAMPLES
% nifind /printers/inky
/printers/inky found in /software, id = 202
/printers/inky found in /, id = 357
% nifind -a /machines/mailhost /sales
/machines/mailhost found in /sales, id = 234
% nifind -v /users/uid=164
/users/uid=164 not found in /sales/polaris
/users/uid=164 not found in /sales
/users/uid=164 found in /, id = 451
% nifind -p /machines/mailhost
/machines/mailhost found in /sales, id=171
name: zippy mailhost
ip_address: 192.42.172.5
/machines/mailhost found in /, id = 350
name: zorba mailhost
ip_address: 192.42.172.1
SEE ALSO netinfo(5)AUTHOR
Marc Majka, Apple Computer Inc.
BUGS
nifind does not complain if domain is not an ancestor specified in a normal search.
Apple Computer, Inc. August 9, 1994 NIFIND(1)