10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I'm currently trying to use variables in grep on my script. Printing the variable via echo works fine. Also, if I hard coded the date of the appointment it works just fine. But, if I try to use the $DATE as an argument in grep it doesn't do anything.
#!/bin/bash
DATE=${2}/${3}/${1} ... (6 Replies)
Discussion started by: nuclearpenguin
6 Replies
2. Shell Programming and Scripting
i have this line of code that looks for the same file if it is currently running and returns the count.
`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`
basically it is assigned to a variable
ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The issue I am having is part of a validation problem. My script will validate 3 or 4 parameters entered by the... (4 Replies)
Discussion started by: JonLaberge
4 Replies
4. Shell Programming and Scripting
Good day Geeks,
Am having an issue with using variables in a rather simple script, the script is as follows:
#!/bin/bash
### Script written by Adigun Gbenga
### Date: April 28, 2012
array=( 1 2 3 4 5 29 7 8 9... (6 Replies)
Discussion started by: infinitydon
6 Replies
5. Shell Programming and Scripting
I would like to know if grep can extract the following requirement.
I have the folllowing piece of SQL in a file and need to grep the FROM part.
mp db-ter-fast-export C100_Input_Target_Table__table_ "${DB}"'/teradata.dbc' -select 'SELECT UPPER(trim(proj_id)) as proj_id,
latest_job_id,... (9 Replies)
Discussion started by: anduzzi
9 Replies
6. Programming
Hi all,
I have a problem, I need a grep -v but, the patterns of the grep should be C variables.
Example:
char var1="h";
char var2="o";
char var3="d";
system("grep -v \"var1 var2 var3\" file.txt");
----
----
----
I try it but... Can u help me?
Thanks beforehand
P.S. Sorry for... (4 Replies)
Discussion started by: AbelBs
4 Replies
7. Shell Programming and Scripting
Hi,
I have a reqmt as i have some values in array and I want to search each value in a file by grep command.
Here goes my scripting:
#!/bin/ksh
set -A ArrayA CENTER LEFT RIGHT
echo "ArrayA contains: ${ArrayAİ*¨}"
grep -e "${ArrayAİ*¨}" filename.txt
The above grep is working for... (4 Replies)
Discussion started by: prashant43
4 Replies
8. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies
9. Shell Programming and Scripting
i have such awk working fine but how to use variable instead of strings
awk '/asdasd.*asda.*asdasd/' file2.txt
This is not working:
awk '/${a}.*${b}.*${c}/' file2.txt
Thanks & regards
Peter (7 Replies)
Discussion started by: pp56825
7 Replies
10. Shell Programming and Scripting
Being new to shell scripting I hope this question isn't too elementary but here goes.
I run a grep statement - grep 'sqr' sqrmodule.par and the grep statement returns correctly the information that I'm looking for. Now I want to take the output from the grep statement and load it into a... (2 Replies)
Discussion started by: gettingstarted
2 Replies