Tagged Questions
1
vote
3answers
161 views
Possible improvements for this small C program?
I'm learning C and today I wrote a program that displays info about my hardware on ubuntu.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch, file_name[25] = ...
2
votes
2answers
93 views
Need some advice and feedback on my C code calling Bash functions
My intent is to use Bash functions defined in functions.sh in a C program. I am doing this so that I don't have to rewrite the Bash functionality again in C. I want to use one common library for ...
1
vote
3answers
901 views
Bash script to swap out, edit host files
So this is my first useful bash script. It's meant to make it easy to switch between a "work" hosts file (that blocks sites like reddit.com, youtube.com, etc.) and my normal hosts file, and also to ...
2
votes
2answers
83 views
How to improve the way I handle greping in this script
What my script does is:
Append data to a file on a continuous basis.
If an error pattern is observed, then do something.
I need feedback on the way I am grepping for patterns in the continuously ...