The Unix operating system is a general purpose OS that was developed by Bell Labs in the late 1960s and today exists in various versions. It is known for its large collection of simple command-line utilities which allow powerful file handling and text processing capabilities to be implemented via ...
0
votes
2answers
24 views
How to join two files in shell script
I have two file in unix. I just want to add two file content with column wise
file 1: file 2:
2013-09-09 5656 2013-09-09 4321
2013-09-10 1234 2013-09-10 3234
...
0
votes
1answer
14 views
OCIlib library.c: No such file or directory
I try to do select with OCILib. Here the snippet:
int oraconnect()
{
OCI_Connection* cn;
OCI_Statement* st;
OCI_Resultset* rs;
OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT);
cn = ...
0
votes
2answers
29 views
Shell or an awk script to find the occurrences of words [on hold]
I request a shell or an awk script that finds out the occurrences of words that have three occurrences of the same letter. Example - arcadias.
thank you.
4
votes
0answers
83 views
Why doesn't Linux follow Unix syscall conventions?
I'm teaching myself Linux assembly language and I've come across an interesting difference between BSD and Linux. In Unix, you push your syscall parameters onto the stack before calling an 80h ...
0
votes
1answer
70 views
Using fflush(stdin) in linux [on hold]
I use ubuntu 12.04 and gcc compiler.
I am reading several strings, but sometimes some string reads '\n'.
So I want to use fflush(stdin). Since it's not there, how can I implement it.
I also heard that ...
0
votes
2answers
17 views
Replace field value with sequence number
I have scenario like this
file1 has
cat file1
aa~bb~1~dd
xx~yy~2~kk
cc~ff~3~pp
.......
I want to update the file like this
cat file2
aa~bb~20~dd
xx~yy~21~kk
cc~ff~22~pp
.......
tried with the ...
-2
votes
0answers
6 views
How can i unmount the view which is already in use somewhere else
I have a view mounted to a server.
Sometimes the umount command throws the below error-
umount.nfs: /home/usrName/view_irs: device is busy
mount.nfs: /home/usrName/view_irs is busy or already mounted
...
-1
votes
1answer
20 views
Search for particular fields and print them in new file in unix
I am searching for one line command to search for few words in 'myfile.txt' and if pattern match then cut that words and print it in new file.
myfile.txt.
162.23.55.222 - - [07/Dec/2013:00:40:35 ...
0
votes
0answers
6 views
Use Esri CityEngine features external code
I am trying to automatize the process of importing GIS data from OpenStreetMap to CityEngine, generating the 3D model I need and exporting it. CityEngine provides a Python scripting feature inside the ...
0
votes
0answers
11 views
Applet super laggy in unix and throwing exception
I have an applet that has been working when I've been running it from a workspace folder on my computer, but now that I'm trying to run it through a unix server it is super laggy and runs but throws ...
0
votes
7answers
46 views
Using sed or VIM to replace space with new line
I have the following data.
1455931_at Chrna3 1420468_at Asb17 1445520_at −−− 1436717_x_at Hbb−y 1431788_at Fabp12 1458975_at −−−
With sed or VIM editor how can I change it to
1455931_at Chrna3
...
-2
votes
0answers
30 views
Unix PATH issue
Now give yourself execute permission for the 'phone' script, for example:
chmod u+x phone
Also, add your 'scripts' directory to your PATH:
PATH=$PATH:~/scripts
Now try running 'phone' and make ...
0
votes
2answers
36 views
Running python file on command line?
I have a python script "program.py" that takes 2 command line arguments.
When I want to run this program on command line, I should enter:
./python myprogram.py arg1 arg2
However, I want to run ...
0
votes
1answer
27 views
OS X: $ cat /dev/random asks me to print
When I run:
$ cat /dev/random
on OS X 10.9, after a short period of time, a print dialog pops up asking me if I want to print gibberish (iTerm2).
Using the native terminal application, it just ...
-2
votes
3answers
57 views
What is the meaning of exclamation '!' in shell scripting?
if [[ ! -d /home/pp ]]
then
print "$0 Directory /home/pp doesn't exist"
return 1
fi
What is the meaning of !, $0 and return 1 here?
2
votes
1answer
14 views
GNU Plot Code error
I know that
gnuplot> p 'filename'
would plot the graph
I wanted to know how does this code exactly run
gnuplot> p 'filename' u 10:(($3==4 && $9==1000)?$13:1/0) w lp
2
votes
4answers
52 views
Using only Posix features, what is the most efficient way to grow a file to X bytes large?
My Posix C program needs to grow a file to X bytes large - typically 128MB or 256MB.
The current approach is to initialise a memory buffer of 16MB and repeatedly write the buffer into the opened file ...
0
votes
1answer
52 views
Function to create n child processes
int proc_create(int n)
{
int pid;
n = n+1;
printf("The parent process id: %d\n", getpid());
while(1)
{
if(pid=fork() < 0){
perror("Fork Failed!");
exit(1);
...
2
votes
3answers
31 views
Compare Date-Time Stamps
I am looking to write a shell script that will compare the time between two date-time stamps in the format:
2013-12-10 13:25:30.123
2013-12-10 13:25:31.123
I can split the date and time if required ...
4
votes
3answers
100 views
Outputs of “ls *” are inconsistent
Just confused about the outputs of command "ls *". I tested below scenario both in Ubuntu 11.10 and Redhat Enterprise 6.3, got the same results.
Shell log
$ uname -a
Linux ...
1
vote
2answers
27 views
stdin to zip command instead of prompt
Want to protect my ZIP archive with password.
Create archive with this:
zip -er archivename.zip file
and get this:
Enter password:
Verify password:
Everything is ok,but I have variable with ...
-4
votes
0answers
24 views
First i want to connet sql server and then i want to execute SQL queries in the unix [on hold]
xyz program here then it connect sql this xyz program should have the have the command to execute below one.
SQL > here i want to eecute the SQl commands but xyz program itself should execute without ...
2
votes
3answers
33 views
Exact meaning of PHP max_execution_time
The phrase "maximum execution time" is ambiguous: it could mean (a) the elapsed time since the script started, or (b) the total cputime taken by the script (including or excluding the cputime taken by ...
0
votes
1answer
42 views
select() call on regular text file's file descriptor
I am facing strange issue, select return 1 value every time.
Below is my code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include ...
0
votes
1answer
21 views
Unix: Same executable, different user: different executable version?
I'm being very confused by the following happening in my terminal:
my-computer:~$ which java
/usr/bin/java
my-computer:~$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build ...
0
votes
2answers
19 views
script for zipping the files with 10 days back files in one folder in unix?
i am trying to zip log files by using "zip " command in UNIX server.
but i want to zip 10 days before files automatically,with out changing the command manually. can any one suggest the script for ...
0
votes
0answers
16 views
SSL communication with mounted drive in Unix [on hold]
I've mounted a drive on a machine. The mounted directory is nothing but Hadoop HDFS.
Now, I need to provide a secure communication with it i.e via SSL/HTTPS.
Is there any way to achieve it ?
If not ...
0
votes
1answer
56 views
How to handle error conditions of pthread_mutex_destroy
When I try to destroy mutex via pthread_mutex_destroy(&mutex), it intermittently fails.
I am doing an assert if the pthread_mutex_destroy fails. But do we have a better option compared to assert ...
0
votes
1answer
22 views
Unix menu shell script: adding, listing, and extracting files to .tar
I'm trying to create a menu based script that has 3 options
1. add files to .tar
2. list the contents of .tar
3. extract the tar file contents
This is what I have so far. I'm still new to unix so ...
0
votes
0answers
23 views
y86 only executing one line
I'll get right to it.
So I've made a simple y86 program to store and add some values with the registers and found it pretty simple to figure out. However, I am getting a weird output at run time. I am ...
0
votes
0answers
17 views
Position of options in osx commands [on hold]
I just switch from linux to osx. And I find the position of command options works differently.
For example, both
ls file/ -al
ls -al file/
works in linux, but only the latter works in osx. The ...
1
vote
1answer
33 views
What's the difference between 1/1/1970 and 12/31/1969 UNIX epoch invalid dates?
I know that when there's an invalid UNIX date, the default time is Epoch, but I see that some servers' default is 12/31/1969 while others servers' default is 1/1/1970. What's the difference between ...
-1
votes
0answers
17 views
armv4 on windows is there/ how to make lunix or android os [on hold]
I have a netbook with windows 7 embedded armv4 1gig of storage and 512mb of ram, that has wifi capabilities. Is there a version of lunix or android(preferred) that would be able to be an alternative ...
0
votes
0answers
22 views
Is possible to create in Java a function similar to “locate” for Unix using SQLite? [on hold]
I am developing a small desktop application in Java for showing a few features of some files. I have thousand of these files so I store them in a SQLite database. The point is how can I update the DB ...
-1
votes
1answer
35 views
bash - calculate process' time, i/o, cpu, memory usage [on hold]
I need a script which will start some process and calculate it's time of running, cpu usage, memory usage, hdd i/o usage in linux. System has 1 processor. Is that possible to determine that? Thank ...
-1
votes
1answer
40 views
Bash: back ticks character shielding strange behavior [on hold]
How does the following work?
[crimsonlander@users ~]$ echo `echo 1\ 1` #1
1 1
[crimsonlander@users ~]$ echo `echo 1\\ 1` #2
1 1
[crimsonlander@users ~]$ echo `echo 1\\\ 1` #3
1\ 1
...
0
votes
1answer
15 views
linux command line :file names that contain a number & replace string
so i am new to linux
and I was wondering how do i do the following
1-list all names of file that contain a number
[I know
$ls *[0-9]*
but it wont work if i have a file that starts with a ...
0
votes
1answer
13 views
csh issue retrieving input from multiple lines
The following script is being run on a HP-UX box that has only csh.
#!/bin/csh -fx
set todaysDate = `date +%m%d%y-%H:%M`
echo -n Paste the email information here:
set input = $<
set info = `echo ...
4
votes
1answer
33 views
Bash: back quotes and eval confusing behavior
Can someone explain the second result?
user$ set 5 5
user$ n=2
user$ eval echo \$$n
5
user$ echo `eval echo \$$n`
10268n
10268 is bash pid.
GNU bash, version 4.0.35(0)-release ...
1
vote
0answers
19 views
pipe output of “script” command _without_ buffering
I am capturing some terminal session output (using the "script" command) for testing.
The script command works great, gets everything no matter what, even sub-shells and remote login sessions. ...
0
votes
1answer
23 views
Calling a C function periodically on OSX
I have a function which calculates a BPM for a track from incoming data packets from a CDJ. Lets say the BPM was 124.45 beats per minute, how would I go about calling a function every 0.482 seconds ...
1
vote
1answer
32 views
JSoup select from HTML in unix
I have a program that extracts certain elements(article author names) from many articles, from the PubMed site. While the program works correctly in my pc (windows), when i try to run it on unix ...
0
votes
1answer
29 views
Unix Regular Expression in Grep
I have some lists named
20131101_klm
20131101_abc
20131102_klm
20131102_abc
.
.
First numbers are time stamp like 20131101_klm is klm list in 01.11.2013 and so for abc for everyday.
These list ...
0
votes
4answers
28 views
Need to validate the length of a variable and perform an action accordingly in unix
We have a variable with a value in it. My requirement is if the length of the variable is greater than 0(zero) do something else do another thing
Step1: I have a variable with some value say
...
0
votes
0answers
13 views
org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized
Hi in our project we are using XJC ant task for xsd2schema generation after that we are compiling the src files and grouping them into a schema jar.
the classpath we have for that is:
jaxb-ri-2.2.6 - ...
-1
votes
2answers
30 views
how to compare values in the same field?
I have this input
name num value
A 1010232 1
A 1010232 2
A 1010232 3
B 2565214 1
B 2565214 2
B 2565214 3
C 6111111 2
C 6111111 3
.
.
O need ...
0
votes
2answers
40 views
C socket get IP adress from filedescriptor returned from accept
I know this question seems typical and multiple times answered but I think if you read the details it is not so common (I did not find it).
The point is that I am developing a unix service in c that ...
1
vote
2answers
31 views
grep not returning path when finding only 1 occurence
For some ddl files containing a specific pattern I need the full path and filename. I am using the command: find /opt/releases/packages/cr666/sas/dbms -name *.ddl | xargs egrep -i -w ...
0
votes
1answer
15 views
Ocilib for Suse 10.3
Where could I find ocilib for Suse 10.3?
I need to communicate with oracle from this os. Our admin won't make any upgrade and I can't use the newest version because he gets a lot of dependency ...
0
votes
3answers
39 views
Count the occurance of items in a file comparing it in another file?
I have two single column files. File 1 looks like
red
green
blue
red
red
green
black
There can be repeated samples in file 1 but items are not repeated in file 2. Similarly, file 2 has the list
...