10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
(I am using bash)
I have a command that will find the line number in a file by searching for a string where it exists.
linenumber=$(grep -n "string" $FILENAME | cut -d : -fi)
This returns the line number and removes the string. Now that I have the line number I want to subtract 4 from it and... (5 Replies)
Discussion started by: prodigious8
5 Replies
2. Shell Programming and Scripting
I am working on a script for Mac OS X that, among many other things, gets a list of all the installed Applications. I am pulling the list from the system_profiler command and formatting it using grep and awk. The problem is that I want to be able to use each result individually later in the script.... (3 Replies)
Discussion started by: cranfordio
3 Replies
3. Shell Programming and Scripting
I am new to ksh scripting, specially array. How do i get values from an array and set the value as variable and pass those variables to the different functions??
someone taught me how to get input from a file with have columns i need to read, but now i doesnt know how to set those value to be a... (7 Replies)
Discussion started by: gavin_L
7 Replies
4. Shell Programming and Scripting
Hi,
I have table in sql ..from this table im storing the first coloumn values in shell array variable ...
after this passing this variable as an arugument in SQL procedure.
But the proc. is running fine only for 1024 values in array ...
How to store more than 1024 values in the array... (5 Replies)
Discussion started by: ankitknit
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am writing a shell script where,
x=y
y=z
When I want to print z, I can do
$y
How do I use only "x" without any direct reference to "y" to print z?
Thanks,
-G (3 Replies)
Discussion started by: gaurab
3 Replies
6. Shell Programming and Scripting
hi all
I am using awk utility to parse the file and fetching two different vaues from two different record of a record set.
I am able to see the result, now i want to store the result and perform some check of each values form database to mark valid and invalid.
could you please help me... (3 Replies)
Discussion started by: singhald
3 Replies
7. Shell Programming and Scripting
i have a file called file.txt having the following entries.
2321
2311
2313
4213
i wnat to store these values in a list and i want to iterate the list using loop and store it in another list (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
My code is as below:
integer i=7
while ((i <= 5 ));
do
# test_out is a variable which contains data separated by "^".
a= `echo $test_out | cut -d"^" -f$i`
echo "$a"
(( i = i + 1));
done
From the above code, i kept $i after f so that i can capture all the data which is... (1 Reply)
Discussion started by: sandeep_1105
1 Replies
9. Shell Programming and Scripting
i have these values inside variable $blah
BUNGA TERATAI 3 5055 ITH 1 0 0 0 1 1
JADE TRADER 143W ITH 4 0 0 0 4 4
MOL SPLENDOR 0307A ITH 3 0 0 0 3 3
so how do I split them into array with the... (4 Replies)
Discussion started by: finalight
4 Replies
10. Shell Programming and Scripting
Hi All,
Here is the description of the problem.
I am scripting for database access using k-shell on solaris box
dbaccess <databasename> - << EOF 2>/dev/null | awk 'BEGIN {FS=" "}\
{printf "%s", $1}' | grep -v "^$" | \
read cnt1
OUTPUT TO PIPE cat WITHOUT HEADINGS
select count(*) from... (1 Reply)
Discussion started by: matrixmadhan
1 Replies