Skip to main content
2 votes
Accepted

Use fallocate with numbers from text file

If you're trying to loop over a sequence of whitespace separated numbers in a single line of list.txt then one way to do so in the bash shell would be to read them into an indexed array: read -a ...
steeldriver's user avatar
  • 81.9k
1 vote

Get a list of all user's commands from a non-interactive shell

Turns out, I was quite close to the solution. I was confusing login shells and interactive shells. Different things. Instead of $SHELL --login, all I needed to do was $SHELL -i. The following will ...
zoickx's user avatar
  • 51
1 vote
Accepted

join a specific number of files/devices in linear mode together in a linux system

You can use a for loop to iterate from zero to 32, and store the device names in an array. # you don't show the file, there are programmatic ways to acquire this number n=33 devices=() for ((i = 0; i ...
glenn jackman's user avatar
1 vote
Accepted

Using awk, append a value in last field in csv file based upon value in specific field

Here's one awk approach: ## This function takes as input an awk array whose indices are ## IDs and whose value is the number of times that ID has been seen. ## It returns the ID with the maximum value....
terdon's user avatar
  • 245k
1 vote

Using awk, append a value in last field in csv file based upon value in specific field

This sounds too complicated to do it reliably and quickly in awk. You'll want to treat your "row groups" individually. A program in a mainstream programming language with a reasonable CSV ...
Marcus Müller's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible