EnterUserNameHere
  • Member for 4 years, 4 months
  • Last seen more than a month ago
  • East Coast USA
systemd timer enabled but status is inactive
3 votes

systemctl enable while-test.service systemctl enable while-test.timer You may need to run these with sudo. This enables the service and timer at boot. Verify that it is enabled with: systemctl list-...

View answer
bash - case-insensitive matching of variable
3 votes

Keep your existing command but on the line before it run this: LINUX_CONF=$(echo $LINUX_CONF | awk '{ print tolower($0) }') Regardless of the case of the value stored in your variable this will ...

View answer
how to assign log as a variable in bash
2 votes

Try this change fd="" tmplog="/tmp/temp_${$$}_${RANDOM}" tail -1000 /var/log/syslog > "$tmplog" exec {fd}<"$tmplog" while IFS='' read -r -u $fd line || [...

View answer
How can I compare two files line by line?
Accepted answer
2 votes

I can't speak to how portable this is but I tried to cover all the bases. I did my best to replicate the two files in my testing based on your information. If you run into special character issues ...

View answer
Bash parameter expansion
Accepted answer
2 votes

The answer to this question seems to be that NOT ALL string parameter expansions work on arrays. After reviewing the comments and reading the Bash Reference Manual (link provided by don_crissti, ...

View answer
Transfer script
Accepted answer
1 votes

Just a few changes to what you had. The main changes are using globbing to find the files and parameter expansion to carve out the parts of the file paths and extensions. Enable the nullglob option so ...

View answer
Shell script to compile C files
1 votes

Looking specifically at your question it appears that “where you went wrong” is in your parameter expansion. I think you were trying to change the value of i when naming the output file here: {$i%.} ...

View answer
Setting Gateway Address via Network Interfaces File
1 votes

From a networking perspective you have network gateways as a next hop versus a default gateway also known as the gateway of last resort. From your first route -n command (without post-up) you are ...

View answer
Run certain function in bash script based off flag
0 votes

You aren’t passing the argument that accompanies your flag to the function. The variable that holds the value for the getopts flag is OPTARG. main() { while getopts "f:s:k:" opt; do ...

View answer
Fix integer expression expected when the variable can be empty
0 votes

Combine your season if statements into a single statement. Then repeat for episode. if [ "$season" == "null" ]; then # you could also perform some other assignment here season=""; elif [ "$...

View answer
conditional replacing rows with a number
0 votes

Probably not efficient enough for 11 million files but it's a different approach on the substitution. Takes one argument on the command line; the name of the directory where all of the files are ...

View answer