Monday, January 7, 2013

what is the best way to extract part of a string from a linux file?

Q. I have to get the version of a software package from a linux file.
i.e. the file has the line below,

VERSION=1.5.3.0

Whatâs the best way to retrieve the "1.5.3.0"

Thanks in advance.

A. You would use a search tool like grep. You would have a command something like this:

cat file | grep "VERSION" | grep -o "[0-9].[0-9].[0-9].[0-9]"

That makes a pipeline that finds the line then extracts the four number version from it.

Is there any way to format a hard drive with Linux file system under windows?
Q. I need to be able to format my drive with linux file system in order for it to work in the western digital NAS enclosure. Thanks.

A. Steven's right, but you'll need some extra software to put files on or even view the partition from Windows. There are a few options, the best probably being:

EXT2IFS - top link

EXT2FSD - bottom link

Can you open a linux file using windows?
Q. I need to open a linux file using windows.
I don't have linux installed anywhere on this system.
Is it possible to open a linux file using windows? If so, how and what?

A. Yes, you can open Linux files on Windows. Whether or not you have the necessary program/emulator installed which can read/interpret/run that file is another matter, and depends on what specific type of file you're talking about.



Read More Click Here

No comments:

Post a Comment