Search Results

Search: Posts Made By: uniran
977
Posted By uniran
It`s in my second post: ./example1 bash:...
It`s in my second post:

./example1
bash: ./example1: No such file or directory
3,395
Posted By uniran
Execl() command
Hi,

If I write in a c file :

execlp("date","date",NULL);
printf("A\n");
And then run through the terminal would "A" be printed ?

I understood that execlp will exit the program after it...
977
Posted By uniran
I did 'gcc -o example1 first.c'
I did 'gcc -o example1 first.c'
977
Posted By uniran
This is what I get when trying to run the object ...
This is what I get when trying to run the object
./example1
bash: ./example1: No such file or directory


Though I did add the error that showed when I tried to run the first.c file:
./first.c:...
977
Posted By uniran
Problem running a C file through the shell
Hi,

I have tried running c file with:
gcc -o example1 first.c
./first.c




But got :


./first.c: line 6: syntax error near unexpected token `!=0'
./first.c: line 6: `if( fork()!=0 )'...
595
Posted By uniran
Sending an argument to a .sh file
Hi,

This is the content of a file name "test.sh":

#!/bin/bash
if [ ! -f $2 ]; then
echo "I am Here"
fi

When runing the command:
./test.sh chair table

The echo command "I am Here"...
944
Posted By uniran
Semaphore
I was asked to add this piece of code to a c program which I will execute through the shell:

for(long i = 0; i < NITER; i++)
{ sem_wait( &sema);
count++;
sem_post( &sema); }

I didn't get it,...
1,287
Posted By uniran
Thanks, but it ended up the same way
Thanks,

but it ended up the same way
1,287
Posted By uniran
Running process in the background
Hi,

I have this simple c program that creates duplicate process with fork():

#include <sys/types.h>
main()
{
if (fork() == 0)
while(1);
else
while(1);
}

I tried running it in the...
625
Posted By uniran
I understood the supposed function of sed with &,...
I understood the supposed function of sed with &, but this explanation (I read something similar before posting) doesn't explain to me why the set of numbers appears twice, and how the output came to...
625
Posted By uniran
sed pattern &
Hi,

I can't seem to understand what the sed and & do.. Why is the set of numbers appear twice ? how the command really work ?

echo "123 abc" | sed 's/[0-9]*/& www &/'


Output:
123 www 123...
614
Posted By uniran
Thank you, so the x=$1 assignment doesn't serve...
Thank you, so the x=$1 assignment doesn't serve any noticeable purpose in this script ?

B.In truth, the for loop doesn't iterates just three times for $1 $2 $3 as defined but rather one time for...
614
Posted By uniran
Understanding a script for sum
Hello,

How come the following script adds each numeric value to a total sum ?

x=$1
func()
{
for i in $1 $2 $3; do
let x= $x+$i
done }

func "8 8 8" 9 9

echo $x



A.How the...
692
Posted By uniran
Unexpected result from awk
Hello,

Giving those commands:

cat > myfile
1
2
3
^D
cat myfile | awk '{ s=s+$1 ; print s}'

The output is:

1
3
6

It seems like this command iterates each time on a different...
Showing results 1 to 14 of 14

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