Execution problems with the jar -tvf command and "if" logic
Hi,
I am reading a directory that has a list of jar files. I am searching these files for specific keywords. What i would like to do is write the address of the jar file to a new file if the search result is returned as false. For example;
is the file i am searching.
where $i is the current jar file being read.
If the grep -v command returns false i.e. the word "car" was not present in the file, then the address
is written to a new file instead of the actual content of the file itself.
i am currently using an if statement with a test case e.g.
However i cannot get the logic right and i keep writing the content of the jar file to a newfile instead of the address of the jar file itself.
Any help would be greatly appreciated.
Apologies in advance if code was not bracketed properly.
What is the value of $JarDirectory ?
Does it point to a file or a directory?
If it is a file, what is in the file?
Are you looking for the string "car" in the name of a file in each archive or are you looking for the string "car" in the contents of each file in each archive.
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi All,
I am having 7 jar files in a dir. abc like listed below
bash-3.00$ cd abc
bash-3.00$ ls
123.jar
23wdawd.jar
dfsa23.jar
dsa.jar
wew234.jar
adsd234234.jar
dfsda423.jarNow i want to assign all this jar files to a variable in the below format
... (6 Replies)
I am trying to understand why the runnable jar file runs on one Unix server, but not the other with same environment settings.
I copied exact same test jar from here -->
http://www.javaworld.com/javaworld/javatips/javatip127/MakeJarRunnable.zip
on to both Unix servers. Then changed... (5 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
It seems our administrators had installed the version of the "sort" command not having the -M option. Does anyone have the source code for this routine?
I need to be able to sort on month comparison:
e.g. "sudo at -l | sort -k3M,5" (1 Reply)
I need to change the pka0_host_id 7 to 6 but the command "set pka0_host_id 6" returns "pka0_host_id protected from attempted operation".
How can i do that? please i need some answers soon!!!!! thanx (1 Reply)
I have a DS25 and when i run "show device" don't appear my 'dka.....' and 'dkb....' devices, but i know they must be there, where could be the error? what can i do to see them? (3 Replies)
I have a DS25 and when i run "show device" don't appear my 'dka.....' and 'dkb....' devices, but i know they must be there, where could be the error? what can i do to see them?
I'm using Tru64
PD: Im so sorry if i repeat this Q but i really need an answer and i dunno where to ask... (6 Replies)
I need to change the pka0_host_id 7 to 6 but the command "set pka0_host_id 6" returns "pka0_host_id protected from attempted operation".
How can i do that? please i need some answers soon!!!!! thanx (1 Reply)
I used to be able to run "at".
Then I started getting "can't open job file in the /var/spool/cron/atjobs directory".
Based on a newsgroup thread's advice, I logged in as root and entered "chmod 4755 /usr/bin/at" and then got "at: you are not authorized to use at. Sorry.".
In trying to put... (4 Replies)