Search Results

Search: Posts Made By: dariyoosh
1,944
Posted By dariyoosh
Dear Don, thank you very much for your help which...
Dear Don, thank you very much for your help which solved the problem! :b:

In fact I saw the use of getopts for switches in the book "KornShell Programming Tutorial"...
1,944
Posted By dariyoosh
[Solved] [KornShell]: Why getopts doesn't detect disabled switches in this script?
Hi,

My environement

OS: Linux Fedora Core 17 X86_64
KSH version: sh (AT&T Research) 93u+ 2012-08-01
As I understand inside a Kornshell script, the getopts statement allows to...
Forum: Programming 05-20-2010
3,866
Posted By dariyoosh
Hello there, Thank you very much for your...
Hello there,


Thank you very much for your attention to my question. In fact this was the source of the problem. Here is therefore the new version of Makefile

CCFLAGS=-c -Wall
CC=gcc...
Forum: Programming 05-20-2010
3,866
Posted By dariyoosh
A question about Makefile run by GNU make
Hello everybody,

Currently I'm learning how to build projects (C programming) with GNU make. I have a problem with one Makefile and I would appreciate if you could kindly give me a hand. Here is...
3,358
Posted By dariyoosh
A question about kernel module and system power-shutdown
Dear all,


I've just installed a Vanilla kernel (last stable version downloaded from www.kernel.org (http://www.kernel.org/)) as an exercice in order to better understand how to compile linux...
Forum: Programming 08-17-2009
3,669
Posted By dariyoosh
Many thanks for the answers! Kind Regards, ...
Many thanks for the answers!

Kind Regards,
Dariyoosh
:D
Forum: Programming 08-16-2009
11,297
Posted By dariyoosh
Hello there, Thanks for your answer. ...
Hello there,



Thanks for your answer.



Actually, the only reason that I wrote those options in my code was due to
what I read in 'man 2 mount'


#include <sys/mount.h>

int...
Forum: Programming 08-16-2009
11,297
Posted By dariyoosh
A question about the system call mount in a C program
Dear all,



Currently I'm working on a C program (OS = ubuntu 9.0.4)in which a USB key will
be mounted and umounted for several times. I read the man page
of the mount system call.

I use...
Forum: Programming 08-16-2009
3,669
Posted By dariyoosh
Dear jim mcnamara and achenle Thank you...
Dear jim mcnamara and achenle


Thank you very much both of you for your help.
I tried with GCC command line option -D_FILE_OFFSET_BITS=64
and it worked.

currently I'm using ubuntu 9.0.4...
Forum: Programming 08-15-2009
3,669
Posted By dariyoosh
Is there a system call other than 'open' for opening very large files?
Dear all,


Inside a C program, I want to open a very big file (about 12 GB) in order to read its
content. Here is the code:


/*
argv[1] contains the path to the file.
...
Forum: Programming 08-15-2009
13,108
Posted By dariyoosh
Dear pludi Thank you very much for your...
Dear pludi


Thank you very much for your help. Your solution solved my problem.


if (argc != 3)
{
fprintf(stderr, "use: ./myProgram <source file> <target file>\n");
return 1;
}And...
Forum: Programming 08-15-2009
13,108
Posted By dariyoosh
A question about printing error message with perror
Dear all,


I use perror in order to print an error message to the standar error. For example
if a C program is called without its two necessary command line parameters
then :


if (argc !=...
1,743
Posted By dariyoosh
Hello there, I think that the following...
Hello there,

I think that the following KornShell script does the job


#!/bin/ksh

function substring
{
TOKEN=$1
LENGTH=${#TOKEN}
COUNTER=0
typeset -L1 CURRENT_CHARACTER...
2,038
Posted By dariyoosh
Hello there, It may seem a trivial question,...
Hello there,

It may seem a trivial question, but did you try to see whether the grep command itself does the job? (or maybe I didn't understand the exact output form that you're looking for)

:)
1,629
Posted By dariyoosh
Hello there, Your script accepts three...
Hello there,

Your script accepts three command line options -l -h and -g and each of these options requires an argument. The case inside checks the validity of the inserted values. You will run...
3,295
Posted By dariyoosh
When you say the second file is fixed line, do...
When you say the second file is fixed line, do you mean a single line in the file? because if it is the case, I don't really see what is the point for using a second file, you could just assign its...
18,572
Posted By dariyoosh
Ok, try this new version, it must work much...
Ok, try this new version, it must work much faster than the precedent version


#!/bin/ksh

IFS='
'

FINAL_RESULT=""

VARIABLE1="var1 first line
var1 second line
var1 third line
var1...
18,572
Posted By dariyoosh
Did you run my script to see the result? :mad:
Did you run my script to see the result? :mad:
18,572
Posted By dariyoosh
Well in this case, try this #!/bin/ksh ...
Well in this case, try this


#!/bin/ksh

# The fact that we set IFS only on new line is that in this question
# space and tabs are not considered as delimiters, only new lines
IFS='
'
...
18,572
Posted By dariyoosh
Assuming that you don't explicitly write \n at...
Assuming that you don't explicitly write \n at the end of each line, I think the following KornShell script does the job.


#!/bin/ksh

# The fact that we set IFS only on new line is that in...
18,572
Posted By dariyoosh
Maybe what I'm asking seems a bit trivial, which...
Maybe what I'm asking seems a bit trivial, which of the following is the format of your data?


VARIABLE="line1
line2
line3
...
or


VARIABLE="line1\n
line2\n
line3\n
...
What I mean is...
13,449
Posted By dariyoosh
Hello there, I didn't understand exactly...
Hello there,

I didn't understand exactly your problem, you said


and then you say



So finally time is it important or not?



If all of those files have the same pattern, can you...
6,251
Posted By dariyoosh
Yes, you're right, I didn't know that, thanks for...
Yes, you're right, I didn't know that, thanks for this remark :D
6,251
Posted By dariyoosh
Actually both " " and ' ' turns off the special...
Actually both " " and ' ' turns off the special meanings of the meta characters, except that " " doesn't do that for \ $ ' and ".

But from the number of arguments interpretation point of view, at...
4,836
Posted By dariyoosh
Yes, you are right about the fact that \n is...
Yes, you are right about the fact that \n is eliminated from the end of the input by the read function. However even after running

...
echo $value | grep -Eq '\n'
...


$? is 1 and not 0, I...
Showing results 1 to 25 of 48

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