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.
Did you read the usage line in that sample script.?
The sample script I posted tells you how to do exactly that.
scriptname == the name of the script you want to execute
infile == the name of the input file being processed
outfile == the name of the file used to store the processed data
I even made sure the command line example in the script tied the data on the command line to the variables used within the script.
Thus the usage line gives you all the info you ask about.
This example command line
Code:
./myscriptfile mydatafile myresultsfile
would execute myscriptfile in the current pwd reading from mydatafile and writing to myresultsfile.
Your history of scripting indicates that you should understand the use of the variables $1, $2, etc. and what they represent within the script. If not then you really should start doing a little more in-depth studying of scripting. You have been given several references in this thread alone.
Did you read the usage line in that sample script.?
Your history of scripting indicates that you should understand the use of the variables $1, $2, etc. and what they represent within the script. If not then you really should start doing a little more in-depth studying of scripting. You have been given several references in this thread alone.
umm I got the script to work, yet I still got another lecture on this forum.... this is why people think Linux power users and programmers are rude....I even configured sendmail and added the line below to the script to email the file to users. Script has been added to cron job for automation and it is working thus, no need for more lectures.
umm I got the script to work, yet I still got another lecture on this forum.... this is why people think Linux power users and programmers are rude....I even configured sendmail and added the line below to the script to email the file to users. Script has been added to cron job for automation and it is working thus, no need for more lectures.
Sorry if you think you're being 'lectured', but the other side of this is to consider why people are telling you this. When you're asking about scripts (this thread included) you typically show no efforts of your own, past stating what you want to do. So if you've been a user that long, been scripting that long, and have advised others to look at scripting tutorials, and have taken college-level courses in scripting, why can't you show us your efforts when asking for help?? Because as it is, you're essentially ask others to give you scripts, and seem to be confused as to why others get frustrated: https://www.linuxquestions.org/quest...9/#post6369840 https://www.linuxquestions.org/quest...ml#post6352100 https://www.linuxquestions.org/quest...7/#post5830995
Sorry if you think you're being 'lectured', but the other side of this is to consider why people are telling you this. When you're asking about scripts (this thread included) you typically show no efforts of your own, past stating what you want to do. So if you've been a user that long, been scripting that long, and have advised others to look at scripting tutorials, and have taken college-level courses in scripting, why can't you show us your efforts when asking for help?? Because as it is, you're essentially ask others to give you scripts, and seem to be confused as to why others get frustrated: https://www.linuxquestions.org/quest...9/#post6369840 https://www.linuxquestions.org/quest...ml#post6352100 https://www.linuxquestions.org/quest...7/#post5830995
Why are you using echo? You can put the message body on the mail line as is.
Glad it's working for you, but insulting those who you come to for help isn't a good way to get more.
I did not insult anyone here. all I said it is that some of you are rude and love giving lecture to users.. I have read some of your comments to other users too.
I got it... next time I have a question, I will read a scripting book and the links I sent before "daring" to ask a question here. No wonder, it will never be the year of the Linux Desktop.
I did not insult anyone here. all I said it is that some of you are rude and love giving lecture to users.. I have read some of your comments to other users too.
I got it... next time I have a question, I will read a scripting book and the links I sent before "daring" to ask a question here. No wonder, it will never be the year of the Linux Desktop.
And with this response you definitely define the fact that you DO insult those who are trying to assist. Calling us rude and 'lecturers' while failing to provide the requested feedback about what you have tried and what is failing, so we can see your own efforts and then provide suggestions makes you seem a 'help vampire'. (look that up if you do not understand the meaning)
The first 2 links I received are https://en.wiktionary.org/wiki/help_...%20in%20return.
and https://meta.stackoverflow.com/quest...a-help-vampire
There have been 20 posts on this thread, and only one contains a response from you about your own efforts to solve the question (and that was after being given 2 different very clear suggestions and one sample that you slightly modified.) Every other post you made was comments or complaints about the suggestions made including the fact that you have spent 14 years using linux and have never even learned how to check scripts with shellcheck. That comment serves to clearly demonstrate your lack of effort in learning the basic skills needed for linux, including the bash language and scripting.
It is clear that my 12 year old grandson knows more about scripting than you do since you seem to rely only upon the forums for answers instead of trying to learn for yourself.
Last edited by computersavvy; 10-25-2022 at 05:28 PM.
I did not insult anyone here. all I said it is that some of you are rude and love giving lecture to users.. I have read some of your comments to other users too. I got it... next time I have a question, I will read a scripting book and the links I sent before "daring" to ask a question here.
Yes, you actually SHOULD try to learn things for yourself, and write your own scripts before posting...that is the entire purpose of help forums. To get HELP, not to have someone do it for you. Those are called "consultants" ...like the one you claimed to have hired to write this for you in post #10: https://www.linuxquestions.org/quest...0/#post6387450
Quote:
No wonder, it will never be the year of the Linux Desktop.
Linux continues to gain more desktop acceptance, despite your assertion. And sorry, but asking you to show your own efforts to solve your own problem isn't outrageous, so please stop with the fake outrage. Or do you honestly think that if folks just had scripts written for them for free, by volunteers, that somehow Linux would be more popular??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.