Results 1 to 1 of 1
I am using a blkid command to get a list of hard drives / partitions
/dev/sda1.... (each saved as a variable in the end)
/dev/sda2....
/dev/sdb1....
I tried to use
...
- 07-26-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 11
Use csplit (or other command) to split output by line
I am using a blkid command to get a list of hard drives / partitions
/dev/sda1.... (each saved as a variable in the end)
/dev/sda2....
/dev/sdb1....
I tried to use
sudo blkid -s LABEL | csplit N 1 5
csplit ref I used = ss64.com/bash/csplit
Terminal says that the 'N' command is not found, the uppercase N is not shown on my man csplit page so I am guessing that I do not have that command.
I just need each line of this split up so that I can pull information from each chunk.
I do not expect to need this often as it will only come up as an issue with more than 1 usb drive connected, but at that point I need to be able to distinguish between information from 1 drive or the other
***OTHER THOUGHTS***
If anyone wants to add the little bit of extra code that would save each line to a variable that would be useful too
I will also need to run 2 different cut commands on the output of the csplit (thus the need to save as variables above)
thanks for the help


Reply With Quote