10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using ksh , when i try to use for loop i am getting the expected output.
$for variable in $(ps -fu user | grep -i something/ | grep -i something | grep -v grep | awk '{print $2}');do
> grep $variable /tmp/some_path/*/*
> done
when tried the below to remote server, getting... (4 Replies)
Discussion started by: karthikram
4 Replies
2. Shell Programming and Scripting
Hi Team,
I have created a script and using FOR LOOP like this and it is working fine.
for Month in 201212 201301 201302 201303
do
echo "Starting the statistics gathering of $Month partitions "
done
But in my scripts the " Month " variable is hard-coded. Can you please any one... (3 Replies)
Discussion started by: shoan
3 Replies
3. Shell Programming and Scripting
Hi all,
I have a file which I want to split into several files based on a condition. This files has several records. I want one record per file. Each record ends with a //. So, I want to separate files based on this condition. I want split files to be named with the name across the field ID (for... (2 Replies)
Discussion started by: kaav06
2 Replies
4. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
5. Shell Programming and Scripting
Hi,
I am in trouble. I can get inside my condition test inside a loop :
I am in ksh (solaris)
while read file
do
<commande to retrieve file> >> ${LOG_RETRIEVE_FILE.log}
msg_err=$(cat ${LOG_RETRIEVE_FILE.log} | grep "error retrieve")
if ; then
<sendmail>
exit 1
fi
done
I tried... (6 Replies)
Discussion started by: Aswex
6 Replies
6. Shell Programming and Scripting
Hi all,
I am using the below given sqlplus command in my unix script to invoke a stored procedure which returns a value .It works fine.
RET_CODE=$(/opt/oracle/product/10.2.0.4.CL/bin/sqlplus -S $USER/$PASSWD@$DB_NAME <<EOF
EXEC MY_PKG.MY_SP (:COUNT);
PRINT COUNT;
commit;
... (6 Replies)
Discussion started by: Shri123
6 Replies
7. Shell Programming and Scripting
I have a command nested in some while loops to parse some data that looks something like this.
while ($condition)
while ($condition)
...
gzcat /dir/$fileName.gz | grep $searchString > out_file
end
end
On the first loop, the command is executed properly (and takes maybe 10... (3 Replies)
Discussion started by: hobbers
3 Replies
8. Shell Programming and Scripting
I have a logic like this
It initializes the flag variable as "T" at the beginning of the loop everytime
Inside each loop it checks for two conditions and updates the flag variable as "A" or "B"
In the end of the loop it checks for the value of the variable flag for "A" or "B" and execute... (4 Replies)
Discussion started by: codeman007
4 Replies
9. Shell Programming and Scripting
I have a for loop in my script as shown below.
for file_path in $file_list ; do
........my code
..........
......
done
Can i restrict the number of files parsing to the variable file_path as 50?
That is, even if I have some 100 files in file_list, I need to take only 50 files for... (7 Replies)
Discussion started by: Vijay06
7 Replies
10. Shell Programming and Scripting
Hi all,
I have one clarification i am using the loop which will process for each record .suppose there is f ailure in the first record it need to send mail and process the next .my code:
defcount=`cat <filename>|wc -l`
while ]
do
if <some condiotion>
then
echo "mail"
fi
done
so... (1 Reply)
Discussion started by: ithirak17
1 Replies