Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I am using svn to build an app on a daily basis. I have written a script that simplifies the process for me updates svn, builds, etc. I build it 3 different ways then tar the builds to 3 different files and puts them in "home/username/builds/todaysbuild/ which is all working great! except I have to move the files from "todaysbuild" to "Rev12345"
This is where I am stuck, I want the script create a folder of the revision number and move the files there. Currently the last line of the script is "svn info" which reads back to me.
URL: xxxxxx
Repository Root: xxxxxx
Repository UUID: xxxxxx
Revision: 12345
Node Kind: directory
Schedule: normal
Last Changed Author: xxxxx
Last Changed Rev: 12345
Last Changed Date: 2008-12-03 22:28:19 -0500 (Wed, 03 Dec 2008)
If there is a way to read the 4th line of the info after the ":" and make a folder named "Rev12345" and move the files there without user input that would be great. If it can not do it automatically I would not mind that much if the script asked me to enter in the revision number and then make a directory named Rev"what I typed" then move the files there
once the scripts creates the directory.
What do you mean "I know it would take more than that line to do it"? If you know how to do it, why ask? And if you don't know what gawk is, then how do you know that it's more difficult than that.
Anyway, the one-liner provided by odys uses a: pipe, that is, the output of whatever comes before is sent to that what comes after the "|". Before that could be the command to run your script; the output is then used by gawk. You can always use a similar strategy to make some new directory based on gawk's output. I guess you need to make a small script where gawk's output can be put in a variable. I don't know for sure, as I'm not at my linux box right now.
You could also have a look at grep or even sed instead of (g)awk.
What do you mean "I know it would take more than that line to do it"? If you know how to do it, why ask? And if you don't know what gawk is, then how do you know that it's more difficult than that.
Anyway, the one-liner provided by odys uses a: pipe, that is, the output of whatever comes before is sent to that what comes after the "|". Before that could be the command to run your script; the output is then used by gawk. You can always use a similar strategy to make some new directory based on gawk's output. I guess you need to make a small script where gawk's output can be put in a variable. I don't know for sure, as I'm not at my linux box right now.
You could also have a look at grep or even sed instead of (g)awk.
I know i can man gawk! I nicely asked how to do it in my OP. I know what a pipe is, but he put ...| i dont know where he wanted me to put it. maybe you could actually help and put the whole command as thats what i asked for. if i wanted to read manuals i would not ask here.
And this is why Linux will never be Main Stream by the average user!! I would have had an answer on a Windows Batch /Mac Applescript forum days ago. This is so typical in the linux community.
Q. How do i do this?
A. Read the manual.
so annoying....
I didn't ask for a GD manual command. If no one wants to actually help just don't answer. Thanks for nothing and waisting my time and others who search the forum's for something similar time.
Can a mod just close this or remove it so others don't do a search for bash script and get this garbage non helpful thread?
You have gotten some good help here---and very quickly, too (1st response less thatn 30 minutes after the thread was opened.)
Most people here do their best to give useful advice within their personal time constraints. Sometimes all we have time for is: "Awk will do that---check the man page". Another day, you'll get a tome.
We don't alwasy assume that a newcomer has read the man page (or even that he/she knows what a man page, but we do assume a willingness to look at the man page after being pointed there.
Last edited by pixellany; 12-08-2008 at 05:33 PM.
Reason: error
Please do keep in mind - All the people here who are helping you out are doing just that - "Helping". None of them are being paid (by you) to provide you with a solution.
Ideally - like "Morpheus" says in "The Matrix" - "I can only show you the way. It is upto you to take the path"
I think the OP is a "drive by" poster..................
Has one question and then bails.
I would stay if people posted anything useful, again more posts to read about gawk! I asked a question on how to do something and still not an answer on how to actually do it! Just read a man or info page.
CAN ANYONE ACTUALLY HELP ME WITH A WAY TO DO IT? OR SHOULD I FIND ANOTHER FORUM THAT ANSWERS QUESTIONS?
I would stay if people posted anything useful, again more posts to read about gawk! I asked a question on how to do something and still not an answer on how to actually do it! Just read a man or info page.
CAN ANYONE ACTUALLY HELP ME WITH A WAY TO DO IT? OR SHOULD I FIND ANOTHER FORUM THAT ANSWERS QUESTIONS?
With that attitude and unwillingness to LEARN, don't let the door hit you in the arse on the way out. FFS............
The second post really does tell you everything. The RTFM suggestion was really to help you better understand WHY it works.
my system uses "awk"
the "...|"
... in this context means...your code
... = svn info
svn info | gawk...
I'm sure you're right, you likely would have gotten a more explicit answer faster on a windows forum, but in linux, there's a certain amount of sophistication assumed.
We are on the average, very very willing to help, but you need to pick up the reins at some point too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.