04-16-2009
search for key word and execute
Hi,
I am writing a shell (after 6-7 months)that has to receive text from another shell, check if the first line in the text has a key word and then execute different shell.I could come up with the below program structure, please suggest me if there is a better way to do it or please help me with this script.
More deatails:
Have script1, arg1, Myscript (to be writen), triggerScript
*********
# MyScript, should check for keyword inside the text output from script1 and execute triggerScript
arg1="$1"
script1=/./../script
searchText="`$script1 "arg1"`" (Need to get first line of the text out from script1.)
if [ grep for "Keyword" in $searchText && exists/True] ]
then
./tiggerScript (execute trigger script)
fi
********
Last edited by rider29; 04-16-2009 at 02:17 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello:
I need help adding a key word search to my bash script. I have the following script. My boss whats the user to be able to add a search word e.g. unknown failures for the script to search the logs through and find the instances. I had originally done it so it grepped for unknown... (8 Replies)
Discussion started by: taekwondo
8 Replies
2. Shell Programming and Scripting
Hi,
Now i work in a code that
1-get data stored in the database in the form of hash table with a key
field which is the " Name"
2-in the same time i open a txt file and loop through it word by word
3- which i have a problem in is that :
I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies
3. Shell Programming and Scripting
Hi,
I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this:
Records
P1
10,23423432
,77:1
,234:2
P2
10,9089004
,77:1
,234:2
,87:123
,9898:2
P3
456456
P1
:123,456456546
P2
abc:324234 (2 Replies)
Discussion started by: vsachan
2 Replies
4. UNIX for Dummies Questions & Answers
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies
5. Shell Programming and Scripting
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance.
My final goal is to... (11 Replies)
Discussion started by: sachit adhikari
11 Replies
6. Shell Programming and Scripting
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word "description" excluding weird characters like $&lmp and without html tags in the new file output.txt. Help me. Thanx in advance. I have attached the input... (4 Replies)
Discussion started by: sachit adhikari
4 Replies
7. Shell Programming and Scripting
#Build label and text box
$main->Label(
-text => "Input string below:"
)->pack();
$main->Entry(
-textvariable => \$text456
)->pack();
$main->Button(
-text => "Search",
-command =>
sub {
errchk ($text456)
... (4 Replies)
Discussion started by: popeye
4 Replies
8. Shell Programming and Scripting
Hi All,
I have a XML file which is looks like as below. <<please see the attachment >>
<?xml version="1.0" encoding="UTF-8"?>
<esites>
<esite>
<name>XXX.com</name>
<storeId>10001</storeId>
<module>
... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
9. Shell Programming and Scripting
echo {mbr_key,grp_key,dep_key,abc,xyz,aaa,ccc} |
awk 'gsub(/^|abc,|$/,"") {print}'
Required output
{grp_key,xyz,aaa,ccc} (5 Replies)
Discussion started by: 100bees
5 Replies
10. UNIX for Beginners Questions & Answers
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
LEARN ABOUT DEBIAN
git-annex-shell
git-annex-shell(1) General Commands Manual git-annex-shell(1)
NAME
git-annex-shell - Restricted login shell for git-annex only SSH access
SYNOPSIS
git-annex-shell [-c] command [params ...]
DESCRIPTION
git-annex-shell is a restricted shell, similar to git-shell, which can be used as a login shell for SSH accounts.
Since its syntax is identical to git-shell's, it can be used as a drop-in replacement anywhere git-shell is used. For example it can be
used as a user's restricted login shell.
COMMANDS
Any command not listed below is passed through to git-shell.
Note that the directory parameter should be an absolute path, otherwise it is assumed to be relative to the user's home directory. Also the
first "/~/" or "/~user/" is expanded to the specified home directory.
configlist directory
This outputs a subset of the git configuration, in the same form as git config --list
inannex directory [key ...]
This checks if all specified keys are present in the annex, and exits zero if so.
dropkey directory [key ...]
This drops the annexed data for the specified keys.
recvkey directory key
This runs rsync in server mode to receive the content of a key, and stores the content in the annex.
sendkey directory key
This runs rsync in server mode to transfer out the content of a key.
commit directory
This commits any staged changes to the git-annex branch. It also runs the annex-content hook.
OPTIONS
Most options are the same as in git-annex. The ones specific to git-annex-shell are:
--uuid=UUID
git-annex uses this to specify the UUID of the repository it was expecting git-annex-shell to access, as a sanity check.
HOOK
After content is received or dropped from the repository by git-annex-shell, it runs a hook, .git/hooks/annex-content (or hooks/annex-con-
tent on a bare repository). The hook is not currently passed any information about what changed.
ENVIRONMENT
GIT_ANNEX_SHELL_READONLY
If set, disallows any command that could modify the repository.
GIT_ANNEX_SHELL_LIMITED
If set, disallows running git-shell to handle unknown commands.
SEE ALSO
git-annex(1)
git-shell(1)
AUTHOR
Joey Hess <joey@kitenet.net>
<http://git-annex.branchable.com/>
git-annex-shell(1)