Search Results

Search: Posts Made By: pravsripad
1,744
Posted By pravsripad
Thanks both of you. But i could get it to...
Thanks both of you.

But i could get it to work this way: -


#!/bin/sh
REPEATED_FILES=`cut -f1 -d, test_version_file | sort | uniq -d`
for repeat in $REPEATED_FILES
do
grep "$repeat"...
1,744
Posted By pravsripad
Comparing rows and columns
Hi,

i've a .csv file with the data as below: -

file1.h, 2.0
file2.c, 3.1
file1.h, 2.5
file3.c, 3.3.3
file1.h, 1.2.3

I want to remove the duplicate file names considering only the...
1,923
Posted By pravsripad
"which" did not give any results..... And i...
"which" did not give any results.....

And i got it, its an alias.... :-) how simple.....

$alias syb150env
setenv SYBASE $SYBASE150HOME; set pathtmp = (`rm_path syb "$path"`); set path =...
1,923
Posted By pravsripad
Hi guys, its not a script, its not being sourced,...
Hi guys, its not a script, its not being sourced, and i'm unable to locate it in my file system also.

Apparently it sets the environment variables for utilities like sybase, java etc on unix...
1,923
Posted By pravsripad
many thanks.. but how do i use less? can...
many thanks..

but
how do i use less?
can you please write the command?
1,923
Posted By pravsripad
what is syb150env ?
In my csh unix terminal i type in syb150env or syb125env to set the location of the sybase database home...

I know what it does, i.e. sets the address of the env variable to the location where...
3,678
Posted By pravsripad
Can you tell me a workaround to not display this...
Can you tell me a workaround to not display this error on the console?

Redirecting stderr for this particular part of the script only?

2> is for the entire script...
3,678
Posted By pravsripad
interesting observation there methyl, i'll...
interesting observation there methyl, i'll re-check my if statements...

here's the console o/p

+ reader_function 06 2010 # function that reads i/p file
+ [ 25 -ne 0 ]
+ writer_reader...
3,678
Posted By pravsripad
Yep, its working good on the console. The logic...
Yep, its working good on the console. The logic works in the script too and the output is alright, but i'm unable to avoid this error. :confused:
3,678
Posted By pravsripad
Hi, the script is 1000 line huge... The error is...
Hi, the script is 1000 line huge... The error is definitely coming from those three lines... Could it be that the "," is also getting input along with the "N/A" .... i mean the "N/A," will it...
3,678
Posted By pravsripad
it's quite a long piece of code. I've used the...
it's quite a long piece of code. I've used the awk commands in ksh. Tried with (for i=2..) but in vain...

set -x gave me the following output..

+ writer_reader
finale4[89]: N/A,: unknown test...
3,678
Posted By pravsripad
Hi scottn, yes you're right, its not an awk...
Hi scottn, yes you're right, its not an awk error. I'm using this statement in a ksh script on solaris... :-)

I'm basically trying to send in a .csv file full of numbers and N/A's and getting the...
3,678
Posted By pravsripad
No, still not working,... This has taken me all...
No, still not working,... This has taken me all day... :-(

Here is the error
N/A,: unknown test operator

I even tried this.

awk -F"," '{ for(i=1; (i<=NF) && (i !~ /N\/A/) ; ++i) ...
3,678
Posted By pravsripad
Firstly thanks for the quick reply. Your...
Firstly thanks for the quick reply.
Your solution makes sense, but somehow i'm unable to get it to work.
Any other means, can i set the value of N/A to zero or something like that?

----------...
3,678
Posted By pravsripad
Test argument error, unable to solve
Here is an awk statement i am using to sum a series of numbers..

awk -F"," '{ for (i=1; i<=NF ; ++i) sum[i] += $i;} # if (i > max) max=i }
END { s=""; for (i=1; i<=max; ++i) { printf "%s%s", s,...
14,177
Posted By pravsripad
How to execute default in getopts when no option is given ?
hi, here is a ksh script i wrote using getopts...

i want to find out how i can run it in default mode when no option is mentioned and no arguments are provided... ?

i.e if the script name is...
3,086
Posted By pravsripad
simple way to read an array in ksh
hi,
I'm a newbie to shell scripting. I wanted to initialise an array using basic for loop and read it.
Then i want to print it as a .CSV file..
Any help would me much appreciated..
3,902
Posted By pravsripad
yeah, but what if the user does not want to...
yeah, but what if the user does not want to select that mode.. ?

the user should enter the date range along with the choice of mode if he has chosen that mode only..

$OPTARG is the only...
3,902
Posted By pravsripad
that will not do, the user will not be present...
that will not do, the user will not be present when the script is running...
the mode and date range can be specified only in the beginning...
3,902
Posted By pravsripad
Pass date range into optarg
here is the code
echo begin
while getopts 1:2:3:4: mode
do
case $mode in
1)echo "You have chosen mode1"
case $OPTARG in
a) echo "User Specified Date Range"
...
2,216
Posted By pravsripad
Thank You. It works. Is there any way to do it...
Thank You. It works. Is there any way to do it without mentioning the field names in the code ?

It should read file provided the fields are in said format i.e. <field name> : <field value>
2,216
Posted By pravsripad
How to read a file and assign variables to data?
Hi,
I need a simple csh script to read a file containing data like this

Buy Transactions : 175
Sell Transactions : 212
Server: sepo2

i want to read both...
2,357
Posted By pravsripad
Both works great, many thanks. :-) ...
Both works great, many thanks. :-)

---------- Post updated at 11:49 AM ---------- Previous update was at 11:48 AM ----------

I'm a newbie to shell scripting, can you point me to good resources...
2,357
Posted By pravsripad
Help with filtering dates from the calendar
Hi,

I need a simple shell script to help filter weekends from the calendar of a month. In other words, i need a script to identify the working days in a month.
Showing results 1 to 24 of 24

 
All times are GMT -4. The time now is 11:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy