unix

embedd video conference plugin on a unix webserver / php built website

Now, I am really unsure how doable this is but we want to provide a platform for users to video-conference on our website - the software thus being installed on the webserver as perhaps a plug-in. We DO NOT want our users have to resort to 3rd party software (such as Skype) them selves. It needs to be a professional feel and us get all t...

How to find Unix system() function path in C

i am doing a project about shell, and i want the code that gives me the path the system() function uses. example, when i enter the command type dir the reply will be dir is external command (/bin/dir) this is what i reached, but its not working else if(strcmp(arg3[0],"type")==0) //if type command { if(strcmp(arg...

How to implement unix ls -s command in C?

I have to write a program in C which returns file size in blocks just like ls -s command. Please help. I tried using stat() function (st_blksize)...And I am unable to implement it. My code looks like this #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <dirent.h> void main(int argc, char **argv) { DIR ...

Process identifier in the kernel which is portable between linux like versiones

When I use current->pid on ancicent platforms they doesn't support current->pid does *FILE has something equal to pid that ican use ? some we can call it process "key" ? ...

System call time out?

Hi, I'm using unix system() calls to gunzip and gzip files. With very large files sometimes (i.e. on the cluster compute node) these get aborted, while other times (i.e. on the login nodes) they go through. Is there some soft limit on the time a system call may take? What else could it be? ...

How to copy Files from Network folder to Local drive and preserve permissions?

Please close this question. I got what I am looking for and some are arguing it doesn't belong here. All you have to do is zip the files on the mount and drop it in your local HD. All permissions are intact! Is it possible? I have a network disk mounted on Ubuntu. How do I save the files (folders and files recursively) from the networ...

how to identify process in kernel read func without using current->pid

my lecture wants us to build module where we need to identify each read process and where the same read process called twice on the same writer massage we should insert him to an queue who's we wake up when all readers have read I achieved this goal by by using list of pid's and boolean read/not_read inside each node but he decided to ...

search a string in a file as ignoring the lines beginning with #

I want to find a string such as "qwertty=" in a file with "awk" or "grep" but I don't want to see the lines with #. Please see the example grep -ni "qwertty" /aaa/bbb 798:# * qwertty - enable/disable 1222:#qwertty=1 1223:qwertty=2 1224:#qwertty=3 I want to find the line 1223. What should be the search query for this purpose? ...

C language - Fscanf and sprint commands in unix environment

I am trying to read file with 30 rows and 5 columns with separator of "tab". Each time I get only part of the rows. In the windows environment it's working good. Any idea why in unix it is not working? while (fscanf(FFMapFile, "%s\t%s\t%s\t%s\t%s\t", fnfMap[i].COS_ID, fnfMap[i].FF_First_Act, fnfMap[i].FF_Next_Act, nfMap[i].Free_FF_allo...

question regarding page size

Hello guys! I have a question How will you determine the page size of a unix machine using C code? ...

Recursive multiline sed - remove beginning of file until pattern match.

I have nested subdirectories containing html files. For each of these html files I want to delete from the top of the file until the pattern <div id="left- This is my attempt from osx's terminal: find . -name "*.html" -exec sed "s/.*?<div id=\"left-col/<div id=\"left-col/g" '{}' \; I get a lot of html output in the termainal, but no f...

collect the value returned by netstat into a variable

netstat -an | grep hypen echo $variable hypen | wc -l How to collect the value of netstat -an | grep echo $variable | wc -l to a varibale conn_count. ...

How to handle inputs in a C shell program during exec

I am currently writing my own shell program. This simple shell can just execute commands. When executing commands like vi or calc which require input from the terminal , the command is getting executed and is waiting for the input from the user. But I am unable to give any input on the screen. How should the input be handled during the...

How to add the number of active netstat connections of different machine?

I've written this code to get the connections from one machine and adding them with the number of connection of the other machine. This code is not giving any netstat, 0 is coming for the live active connections. #!/usr/bin/ksh -xvf Machine_Detail="prpm@sp204|LC1_R11_LCP|LC1_R12_LCP|LC1_FR15_LCP|LC1_R16_LCP prpm1@sp2048|LC1_R13...

How Do I grep For non-ASCII Characters in UNIX

I have several very large XML files and I'm trying to find the lines that contain non-ASCII characters. I've tried the following: grep -e "[\x{00FF}-\x{FFFF}]" file.xml But this returns every line in the file, regardless of whether the line contains a character in the range specified. Do I have the syntax wrong or am I doing somethin...

Regarding Shell variable

I need to call another shell script testarg.sh within my main script. This script testarg.sh has arguments ARG1 ,ARG2, ARG3. I need to call up the below way: ./testarg.sh -ARG1 <value> -ARG2 <value> -ARG3 ARG1 and ARG3 arguments are mandatory ones. If it's not passed to the main script then I quit. ARG2 is an optional one. If the ...

Regarding PID Shell Script

I am calling another shell script testarg.sh within my main script. the logfiles of testarg.sh are stored in $CUSTLOGS in the below format testarg.DDMONYY.PID.log example: testarg.09Jun10.21165.log In the main script after the testarg process gets completed i need to grep the log file for the text "ERROR" and "COMPLETED SUCCESSFULLY...

find command unix

find and find -depth -print what is difference ? ...

for loop range not working ksh

I tried this, #!/bin/ksh for i in {1..10} do echo "Welcome $i times" done in Ksh of an AIX box. I am getting the output as, Welcome {1..10} times What's wrong here? Isn't it supposed to print from 1 to 10?. Edit: According to perkolator's post, from http://stackoverflow.com/questions/1591109/ksh-iterate-through-a-range It wor...

Combining echo and cat on Unix

Really simple question, how do I combine echo and cat in the shell, I'm trying to write the contents of a file into another file with a prepended string? If /tmp/file looks like this: this is a test I want to run this: echo "PREPENDED STRING" cat /tmp/file | sed 's/test/test2/g' > /tmp/result so that /tmp/result looks like this: ...