77 Answered Questions for the topic UNIX

Unix C Linux

07/23/21

Write a C program with the parent process and a child process communicating with each other using a pipe.

Write a C program with the parent process and a child process communicating with each other using a pipe. The child process will execute the shell command provided by the user via command line... more
Unix C Linux

07/23/21

Write a C program where two child processes are created using fork().

Write a C program where two child processes are created using fork(). The parent process and the two child processes communicate with each other via a pipe. More specifically, the first child... more
Unix C Linux

07/23/21

This exercise shows the idea of how to use one user-defined signal handler to handle two signals.

This exercise shows the idea of how to use one user-defined signal handler to handle two signals. The two signals chosen for this exercise are SIGINT and SIGQUIT. Read (or Google) the descriptions... more
Unix C Language

07/23/21

Write a program simulating an alarm clock.

Write a program simulating an alarm clock. In the main function, you fork a child process, and the child process sleeps for 5 seconds (the number of seconds is an command line argument, see below... more

05/05/21

Write a shell script

Write a shell script which will automatically get executed on logging in. This shellscript should display the present working directory and report whether your friendwhose logname is aa10 has... more

Linux help Assignment Urgent help!

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.- the program reads input... more

Linux assignment help

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.Context:A drop of sweat dripped... more

Linux Programming Help

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.Context:A drop of sweat dripped... more

Help with using VIM editor in Linux

Edit hello.cpp using vimUse vim editor to edit hello.cpp, to have a custom message then recompile the program and run it again.(I dont know what im supposed to type please help)

Help with Computer Science assignment

#1.Create the Hello World program using vi. Save it in your home directory. Instead of the using the “Hello World!” in cout, replace it with “Hello, your name!”Compile the program using g++. This... more

Linux Assignment Urgent Help

INSTRUCTIONSThese three activities are three little shell programs to create and review, one called svi.sh and the other uon.sh, the other is the command_menu program at the bottom of page 456.... more

computer science question

Create this sample file, you can call it student... more

UNIX Assignment

Log on to your UNIX system1. Give three different commands to get back to your home directory.2. Show the names of all hidden files in your home directory. Show your session.3. Write down the... more

06/17/19

What is the Windows equivalent of the Unix command cat? ?

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type... more

06/03/19

What is the fastest way to get the value of π?

I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using `#define` constants like `M_PI`, or hard-coding the... more
Unix Shell Vim Ssh

06/03/19

Delete newline in Vim?

Is there a way to delete the newline at the end of a line in Vim, so that the next line is appended to the current line? For example: Evaluator<T>(): _bestPos(){ } I'd like to put this... more

06/02/19

Extract file basename without path and extension in bash?

Given file names like these: /the/path/foo.txt bar.txt I hope to get: foo bar Why this doesn't work? #!/bin/bash fullfile=$1 fname=$(basename $fullfile) fbname=${fname%.*} echo... more
Unix Linux Diff Bash

05/30/19

Given two directory trees, how can I find out which files differ?

If I want find the differences between two directory trees, I usually just execute: diff -r dir1/ dir2/ This outputs exactly what the differences are between corresponding files. I'm interested... more
Unix Linux Bash Grep

05/29/19

How can I format my grep output to show line numbers at the end of the line, and also the hit count?

I'm using grep to match string in a file. Here is an example file: example one, example two null, example three, example four null, `grep -i null myfile.txt` returns example two null, ... more
Unix

05/29/19

Unix: How to check permissions of a specific directory?

I know that using `ls -l "directory/directory/filename"` tells me the permissions of a file. How do I do the same on a directory? I could obviously use `ls -l` on the directory higher in the... more
Unix Tar Gz

05/28/19

How to uncompress a tar.gz in another directory?

I have an archive > *.tar.gz How can I uncompress this in a destination directory?
Unix Bash Shell

05/27/19

How to represent multiple conditions in a shell if statement?

I want to represent multiple conditions like this: if [ ( $g -eq 1 -a "$c" = "123" ) -o ( $g -eq 2 -a "$c" = "456" ) ] then echo abc; else echo efg; fi but when I execute the script,... more

05/26/19

Why should text files end with a newline?

I assume everyone here is familiar with the adage that all text files should end with a newline. I've known of this "rule" for years but I've always wondered — why?

How can I extract a predetermined range of lines from a text file on Unix?

I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know... more

05/26/19

In Unix, can I run 'make' in a directory without cd'ing to that directory first?

In Unix, can I run 'make' in a directory without cd'ing to that directory first?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.