Search Results

Search: Posts Made By: Raghuram.P
31,358
Posted By Raghuram.P
Running command inside awk
Hi,
I have a awk script to read a CSV file.
After reading the values i want to call a executable (nameely call_it) with the values what i read from the scv file.
I dont want to use system command...
4,747
Posted By Raghuram.P
Try to enclose the $line inside double quotes and...
Try to enclose the $line inside double quotes and use it like "$line"


Raghu
3,434
Posted By Raghuram.P
Hi, For the first scenario if the value of test...
Hi,
For the first scenario if the value of test is empty you may be getting the error.
This can be avoided by putting test inside quotes like if [ -z "$test" ]

if [ $test=" " ] this condition...
1,744
Posted By Raghuram.P
HI, Thanks a lot. It started working After...
HI,
Thanks a lot.
It started working
After posting it i found that the / was creating a problem.
Thanks a again for ur inputs

Raghuram
1,744
Posted By Raghuram.P
Error when using sed
Hi,
I have a input file with following contents


---------------------------------------------------------Run Number: 1-----------------------------------------------------------
test_run...
Forum: Programming 05-15-2007
4,684
Posted By Raghuram.P
Hi, The program basiaclly copies the character...
Hi,
The program basiaclly copies the character entered by the user to the variable c and then rits it to the output.
This goes on until the user enters the EOF character(I am not sure abt the...
2,603
Posted By Raghuram.P
Hi, Are u executing the script from the same...
Hi,
Are u executing the script from the same directory where you executed the command form command line?
Thanks
Raghuram
3,882
Posted By Raghuram.P
HI, Thanks for pointing out the mistake... ...
HI,
Thanks for pointing out the mistake...
Try this one
awk -F, '{for(i=1;i<=NF;i++){if(i==6 || i==18){split($i,temp,":");printf("%s:%s,",temp[1],temp[2]);}else{printf("%s,",$i);}}printf("\n");}'...
3,882
Posted By Raghuram.P
HI Did u Try this cat file | awk -F,...
HI
Did u Try this
cat file | awk -F, '{for(i=1;i<=NF;i++){if(i==6 || i==18){split($i,temp,":");printf("%s:%s,",temp[1],temp[2]);}else{printf("%s,",$i);}}}' > outfile

Thanks
Raghuram
3,882
Posted By Raghuram.P
HI Try this cat file | awk -F,...
HI
Try this
cat file | awk -F, '{for(i=1;i<=NF;i++){if(i==6){split($i,temp,":");printf("%s:%s,",temp[1],temp[2]);}else{printf("%s,",$i);}}}' > outfile

Thanks
raghuram
4,709
Posted By Raghuram.P
HI, AWK has a limitation of the length of...
HI,
AWK has a limitation of the length of records.
That is if a single line exceeds certain length, (I think its 1400 if i am not wrong) then it will throw an error.
Check the version of AWK and...
1,592
Posted By Raghuram.P
Hi, If u can post the part of the code where...
Hi,
If u can post the part of the code where comment is getting printed,then i can take a look into it.
Thanks
Raghuram
7,171
Posted By Raghuram.P
Hi, Check this code echo $filename | awk...
Hi,
Check this code
echo $filename | awk '{if(index($0,"CRE") != 0)
{
if($0 ~ /^1/)
{
printf("2%s\n",substr($0,2,length($0)));
}
else
{
print $0;
}
}
else{print...
9,717
Posted By Raghuram.P
HI, As the file size is more it is advised to...
HI,
As the file size is more it is advised to use C language.
U can make use of pthread to read files. and u can mage the threads easily.

Thanks
Raghuram
19,168
Posted By Raghuram.P
HI, You can get the filename alone excluding...
HI,
You can get the filename alone excluding the directory using following command
for file in `ls test_suite/*.args`
do
F_NAME=$(basename ${file})
done

Thanks
Raghu
2,312
Posted By Raghuram.P
HI, Use this code for i in `ls *_[0-9]*` do...
HI,
Use this code
for i in `ls *_[0-9]*`
do
OUT=`echo $i | awk -F'_' '{print "abc_"$3}'`
mv $i ${OUT}
done

In sed it can be done in a better way but i am not able to get it...
Thanks...
12,023
Posted By Raghuram.P
Hi, Instead of mentioning a full list of...
Hi,
Instead of mentioning a full list of values, mention the cron like this
* * * * * /usr/local/george/update..py
and inside the .py script check for the minute and then run it.
(You may need to...
7,180
Posted By Raghuram.P
HI, $? tells the return value of the last...
HI,
$? tells the return value of the last called function.
In that case it was the function call factorial().

Thanks
Raghuram
7,180
Posted By Raghuram.P
HI, I have made a small change in your code and...
HI,
I have made a small change in your code and it is working fine for me...try it...
factorial()
{
if [ $1 -gt 1 ]
then
y=`expr $1 - 1`
factorial $y
#x=$(( $1 \* factorial $y )) -- I have...
2,457
Posted By Raghuram.P
Hi, I find one problem in your cron.txt you...
Hi,
I find one problem in your cron.txt
you have used sh <scriptname>

instead of that use
6 10 * * * /tmp/ss/script/daily_file_check.sh

Thanks
Raghuram
2,457
Posted By Raghuram.P
Hi, You have mentioned it right,but one...
Hi,
You have mentioned it right,but one change...
As you have mentioned everyday then it should be
10 6 * * * <scriptname>

Thanks
Raghuram
4,110
Posted By Raghuram.P
Hi, Try this one ipcs -s | awk '{print $2}' |...
Hi,
Try this one
ipcs -s | awk '{print $2}' | xargs -o ipcrm


Thanks
Raghu
1,462
Posted By Raghuram.P
Hi, If possible can you post the full...
Hi,
If possible can you post the full source....atleast from first line of ur script till the line where you get the first error..
I can take a look into it.

Thanks
Raghuram
1,594
Posted By Raghuram.P
Hi, According to me best way to check whether...
Hi,
According to me best way to check whether the all arguments are set is to have a default value for all the variables(have separate variable for every option) and checking it at the end of the...
7,071
Posted By Raghuram.P
Hi, Sometimes getting the directory name by...
Hi,
Sometimes getting the directory name by using cut -c61- may lead to error like it may not get the directory name properly.
Try the following code to get the directory name and use your code...
Showing results 1 to 25 of 44

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