10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My code is something like below.
#/bin/bash
for i in `ps -ef | grep pmon | grep -v bash | grep -v grep | grep -v perl | grep -v asm | grep -v MGMT|awk '{print $1" "$8}'`
do
echo $i
ORACLE_SID=`echo $line | awk '{print $2}'`
USERNAME=`echo $line | awk '{print $1}'`
done
=============
But... (3 Replies)
Discussion started by: tapia
3 Replies
2. Shell Programming and Scripting
My requirement is to search for current date-1 .log files in /usr/sas/sas_config/Lev1/SASApp/StoredProcessServer/Logs folder and write the file name to filenames.txt
When I ran the script below, I got error as syntax error near unexpected token `do
I'm not sure what is wrong in my code. I... (11 Replies)
Discussion started by: Ram Kumar_BE
11 Replies
3. Shell Programming and Scripting
HI,
I am facing an error while executing a script in for loop.
the syntax is : for (( i=0;i<=${v_colcnt};i++ )); do
Error : '(' unexpected
I am new to unix and have tried multiple options such as changing the script from !# /bin/ksh to !# /bin/sh (not sure if this works to... (7 Replies)
Discussion started by: Rahul Raj
7 Replies
4. UNIX for Dummies Questions & Answers
I have this output from a loop
a11
1,2
3,4
5,6
7,8
12,8
5,4
3,6
a12
10,11
12,13
15,18
20,22
a13
... (3 Replies)
Discussion started by: maryre89
3 Replies
5. Shell Programming and Scripting
I am using awk to read lines from a CSV file then put data into other files. These other files are named using the value of a certain column. Column 7 is a name such as "att" or "charter" . I want to end up with file names with the value of column 7 appended to them, like this:
... (5 Replies)
Discussion started by: dodgerfan78
5 Replies
6. Shell Programming and Scripting
Have built this script, the output is what I needed, but NR 6 is omitted. Why? Is it an error? I am using Gawk.
'{nr=$2;f = $1} END{for (i=1;i<=f;i++) if (nr != i) print i, nr }' input1.csv >output1.csvinput1.csv
1 9
3 5
4 1
7 6
8 5
10 6
output1.csv > with the missing line number 6. 6 is... (5 Replies)
Discussion started by: sdf
5 Replies
7. Shell Programming and Scripting
I need to get total number of hdisk not assigned to any VGs.
PDC # lspv |grep None |awk '{print $1}' |wc
131 131 1099
So, it shows 131 hdisks.
I need to look at the individual hdisk fget_config info like below:
PDC # fget_config -Av |grep hdisk230
hdisk230 dac1 229... (4 Replies)
Discussion started by: Daniel Gate
4 Replies
8. Shell Programming and Scripting
When I run the following command in the shell it works fine. It prints a city name and then a path for a file.
~$ for i in `awk -F':' '{print $0}' /home/knoppix/Desktop/data/subs | grep -m 1 $ city | sed "s/:/ /"`
>do
>echo $i
>done
Now, when I place it in this shell script (sh) it prints... (6 Replies)
Discussion started by: afroCluster
6 Replies
9. Shell Programming and Scripting
I have tried to implement a while loop into the code but upon running the following code i am getting the errors:
./Assigntest: line 42: syntax error near unexpected token `done'
./Assigntest: line 42: `done'
The code is as follows:
#!/bin/bash
#Filename: Assignment Author: Luke... (9 Replies)
Discussion started by: warlock129
9 Replies
10. Shell Programming and Scripting
i've reworked some code from an earlier post, and it isn't working as expected
i've simplified it to try and find the problem. i spent hours trying to figure out what is wrong, eventually thinking there was a bug in perl or a problem with my computer. but, i've tried it on 3 machines with the... (5 Replies)
Discussion started by: quantumechanix
5 Replies