Skip to content

Tag: linux

Shell Script to extract only file name

I have file format like this (publishfile.txt) I just want to extract the name OMEGA****, sample, sample(1) How can I do that I have used basename in my code but it doesn’t work in for loop. Here is my sample code But this code also doesn’t wor when used outside for loop Answer This simply says th…

Filling empty spaces in a CSV file

I have a CSV file where some columns are empty such as How do I replace all the empty columns with the word “empty”. I have tried using awk(which is a command I am learning to use). I want to have I tried to replace just the 3rd column to see if I was on the right track this left

strstr() and exit(0) trouble in C

so I’m working on a simulated linux shell using C (homework), and I have it exiting the program if the user just simply types in “quit”. However, if they throw “exit” somewhere inside a command… “cat file ; exit” I need it to execute the command like normal, the…