I am writing a program to implement a simple shell in C but when I execute the program at the end when I type exit it does not exit. I am executing in on cygwin hence a.exe is generated. execution of program Here you can see in the above output the program is not able to exit when I am
Tag: linux
mistake in cin.getline() to develop a shell
I am developing a limited version of shell for my self. Here is a C++ program What I am not able to understand is when I compile this program I am getting error in line and the error is following I do a $ g++ p3.7.cpp What is the mistake above I am doing. Do I need to include some
C – invalid conversion from ‘void*’ to ‘void (*)()’
I am getting the following when I try to compile my program: These are the lines of code that are causing the errors: What am I missing? Answer You have void *function but void* is not a correct type of a function pointer. void (*)() is a type of a function pointer, so probably you should change your function…
Can not INSERT INTO Postgresql
simplechan In other words, I installed a message board named simplechan, but I can not log in to a site dedicated to the administrator. Because you need a password to get there. I do not know the password. I entered in psql as follows In “simplechan/sql/create_table_query.sql” it was drawn as foll…
Detect if running on a device with heterogeneous CPU architecture
I’m very specific on this one. I need to know if the device has a CPU which has heterogeneous cores like ARM’s big.LITTLE technology, for instance, a set of 4 ARM Cortex-A53 + another set of 4 more powerfull ARM Cortex-A72, totaling 8 cores, basically 2 processors in the same chip. The processors …
How to efficiently loop through the lines of a file in Bash?
I have a file example.txt with about 3000 lines with a string in each line. A small file example would be: I want to check all repeated lines in this file and output them. The desired output would be: I made a script checkRepetions.sh: However this script is very slow, it takes more than 10 minutes to run. In…
Search and Replace ( multiple lines )
Hello StackOverflow Community! I’m working on a bash script to change in Dynamic text file, I want to replace multiple lines with one line. Ex: This example, I want to replace THIS With KKKKK Before script After script I found a script to replace using ( sed ) but it doesn’t replace multiple lines…
Linux named fifo non-blocking read select returns bogus read_fds
Similar to the problem asked a while ago on kernel 3.x, but I’m seeing it on 4.9.37. The named fifo is created with mkfifo -m 0666. On the read side it is opened with The resulting fd is passed into a call to select(). Everything works ok, till I run echo >> <fifo-name>. Now the fd appears i…
Parse command `watch` with `InputStream`
I have this command: How I can to parse output from this command? When I get InputStream of this Process, I get an empty line every time. — I used to restart the command via Java, creating a new thread and all over again. Now, I decided to implement it with the help of watch. Snippet of code: Answer A
optimizing awk command for large file
I have these functions to process a 2GB text file. I’m splitting it into 6 parts for simultaneous processing but it is still taking 4+ hours. What else can I try make the script faster? A bit of details: I feed my input csv into a while loop to be read line by line. I grabbed the values from the