[SOLVED] started Unix yesterday, im 15 so i don't really know what i'm doing
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
I relly did not undertastand what you are trying to say here. Is anyone able to see the images that the OP is posted?
If you let us know what exactly you see on the computer we can help you.
Do not worry we all start at some point and thoes are the times (mostly) when we do not have an idea of what we are doing.
im stuck because i dont know how to set the file name as a variable
Hint: you don't need to. you don't need to set any variables. Did you look at my SED suggestion?
'nother hint: You're not concerned with the filename---you need to work on the contents. EXCEPT---The file contains filenames!! No matter---you still do not need to set any variables.
Maybe use cat instead of ls? Should read out the contents. Grep would be the way to go though.
If you can use GREP to parse a file, combine pairs of lines, and then remove part of the text, I'll buy you a year's supply of your favorite junk food or recreational chemical.
I stated that this can be done with a one-line SED statement---does anyone disagree?
Not just Grep, maybe you need to get off those recreational chemicals you are offering me. How can Grep parse files. I said it would be included in the code, not gona give the whole code. He won't learn anything... I could be wrong but that's the linux learning curve.
oh, btw i used echo $x to get the file names instead of my variable method because I had already set it. I still don't know how to get the resolutions though.
i hate to just give the answer like this but given that he stated hes just learning i feel like i could be helping by showing an example...
theres probably a shorter way to do this but using sed is your best bet and this is what i came up with...
Quote:
sed 's/File\: //g' *INFILENAME* | sed 's/Resolution\: //g' | sed 'N;s/\n/ /g' > *OUTFILENAME*
edit: posted this w/o refreshing...seems hes getting close and i highly encourage to find an alternate way to get the same result, im sure there is plenty
and if not then read some sed tutorials and get a good understanding of the syntax
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.