Search Results

Search: Posts Made By: AkumaTay
Forum: Programming 11-13-2002
9,056
Posted By AkumaTay
fork() and dup()
I have met this code:

switch(fork()) {

case 0:
close(1);
dup(p[1]);
close(p[0]);
close(p[1]);
...
Forum: Programming 11-07-2002
7,272
Posted By AkumaTay
while ((direntp = readdir(dirp)) != NULL) { ...
while ((direntp = readdir(dirp)) != NULL)
{
if (lstat(direntp->d_name, &statbuf) == -1){
fprintf("...");
else
printf("%s\t%s\n",direntp->d_name, statbuf.st_size);

}

Is it the way to...
Forum: Programming 11-07-2002
7,272
Posted By AkumaTay
Listing File Info
Hi,

From a Unix book, i'd found that the way to list files in a directory.
But those file info are all not shown, wat is shown is only the file name.
Can anyone pls teach me how to show the file...
Forum: Programming 11-02-2002
2,556
Posted By AkumaTay
I need it in C programming. In unix shell i...
I need it in C programming.

In unix shell i can do it easily also..thx anyway!
Forum: Programming 11-01-2002
2,556
Posted By AkumaTay
Check files update
Hi,

I want to monitor a file, and check what has been added to it.

etc: The text file contain "abcdef"
And now it contain "abcdefghi".

I need to know what had been added, is there...
3,453
Posted By AkumaTay
Is it a bugs for find command? :(
Hi!

When i am trying to use find command to seacrh files in current directory, it help me to search for it sub-directory also.

Is there anyway to avoid it?

I am using unix operating system....
17,155
Posted By AkumaTay
shift command
There is an error when i am trying to use the shift command in this way:

($1 = -d, $2 = 123, $3 = -c etc etc)

for $arg in $@
do
case $arg in
"-d") shift; (so that the $2 will...
3,942
Posted By AkumaTay
Thx !..I had got it done!..:) from: AkumaTay
Thx !..I had got it done!..:) from: AkumaTay
3,942
Posted By AkumaTay
compare files acess time
I need to compare x file with y file.
If x file is newer than y file do xxxx;
(I used touch -t yymmddxxx to chnage the time for y file)

How can i do that?

I tried use
if [ $x -ot $y ]
then...
4,839
Posted By AkumaTay
assign to variable
why i can't use this command:

echo $arg | cut -c 1,2 | read remainArg or
echo $arg | cut -c 1,2 | read $remainArg

so that the result will be assign to remainArg.

Anyway to do this? :)
3,199
Posted By AkumaTay
Parameter handling
Hi, i would like to ask that:
If u need to do something like this:
counter = 1;
so that $($counter) = $1, and when u counter++, $($counter) will become $2. How can we do this?
25,087
Posted By AkumaTay
grep tab
I want to grep "xxx(tab)iii" but dunno the way to do it.


I've tried : grep "xxx\tiii" * , but it dont works.
Is there anyone that can help me? :)
1
2,128
Posted By AkumaTay
Linux
I have a 6.4GB hard diskand I have partitioned it into 2 part.
1 for linux(2GB) and 1 for windows(4.4GB).

One day i formatted my windows, which is c:, and later when i install back it, i cant...
1
2,972
Posted By AkumaTay
Split
Is there a split function in shell? (not awk)

Coz i got a string as input and needed to split it.

eg. input = "abc:123:def:www"

I need to split it into 4 variable which contains...
1,947
Posted By AkumaTay
Sed question
My data file look like tis
field1:field2:field3:field4:field5

I wan to compare field 2 with 1 variable and if match change the details of it.

How can i do it?

I used to do it like tis:
#in...
3,236
Posted By AkumaTay
Date Handling
In the shell which have the command prompt '$' ( Sorry i dunno wat shell is this), is there anyway to handle date input?

Coz i need to accept a date from the user and wat i use is:
read day;read...
7,435
Posted By AkumaTay
Passing Argument to Function
May i know how to pass an argument to a function in a shell script?

Sorry, i din stated that it is in a shell script in my previous post.

Means: checkStatus() {
...........
...
26,414
Posted By AkumaTay
Passing argument to awk script
I am writing a shell script.
Now i need to read in a string and send it to an awk file to compare and search for compatible record.

I wrote it like tat:

read serial | awk -f generate.awk...
2,287
Posted By AkumaTay
Why cant?
I need to verify wether a file is exist or not be4 i proceed to my next stage.

So i wrote it like tat:

if [ ! ' ls | grep '^data.dat' ' ]
then
.................
else
...
2,750
Posted By AkumaTay
Awk Script
Hi...i am having problem again..haha

I've an awk script tat read record frm a file.
And it's needed to compare with a argument pass to it.

Firstly i write my command like tis: awk -f gen.awk...
6,512
Posted By AkumaTay
String Handling
I am writing a Shell Script. :)

Now i've problem in handling a string.

Eg: read string1

after i read in the string, i wan to add a space after it.
I've tried 1.) $string1 += " "
...
Showing results 1 to 21 of 21

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