LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-04-2013, 07:11 AM   #1
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,927
Blog Entries: 45

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Bash shell scripting – Part I & Part II


Hi,
Link removed for attack violations;

EDIT: Look here; https://www.howtoforge.com/tutorial/...pting-lessons/
Quote:
This tutorial is a three part series as an introduction to Bash Shell Scripting. Part I is mainly basics of shell scripting and is generic, Part II will gradually move towards some more advanced techniques and focus mostly on the bash shell and finally in Part III we will try to use all the techniques to create working program.

A basic understanding of Linux shell is required for this tutorial. Please refer to Link removed for attack violations to learn more about Linux shell.
Link removed for attack violations;

EDIT: Look here; https://www.howtoforge.com/tutorial/...ing-lessons-2/
Quote:
In the Link removed for attack violations of this article series on shell scripting we covered basics of what shell scripting is and how we can use it like other programming languages to automate our work. Now we are going to cover some more advanced technique such as arrays, functions, networking etc which makes these shell scripts much more than just bunch of commands.
Other useful links in Links for Helpful Linux articles & books

EDIT: Look here for future references for Bash scripting; Advanced Bash-Scripting Guide sorry about the hijacked links above.

Last edited by onebuck; 03-07-2016 at 09:43 AM. Reason: add link& remove attack violated links
 
Old 01-04-2013, 08:51 AM   #2
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
Aha! These are very nice tutorials.

Thanks for the links.
 
Old 01-04-2013, 12:04 PM   #3
rootaccess
Member
 
Registered: Mar 2012
Posts: 311

Rep: Reputation: Disabled
thanks for the links. this is exactly what i am learning right now. literally blocking everything out to learn it well.

edit: do you know of any good bash shell scripting books that are not too costly? I know I can get all this information free but I enjoy being outside and not having all the EMF's running through me, not to mention the glare of the laptops and battery drainage among other things just to read stuff. I feel more focused when I just have bash shell scripting in my hand with no access to anything else on my computer.

I came across this one which was written last January 2012, so its a year old. Is it worth it?

http://www.barnesandnoble.com/w/the-...1593273897&r=1

Last edited by rootaccess; 01-04-2013 at 01:55 PM.
 
Old 01-05-2013, 03:18 AM   #4
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 275Reputation: 275Reputation: 275
As always: thanks about links
 
Old 01-06-2013, 10:17 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rootaccess View Post
yes.
 
Old 01-09-2013, 11:52 AM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Quote:
Originally Posted by rootaccess View Post
It's available for free.

http://linuxcommand.org/tlcl.php

Last edited by dugan; 01-09-2013 at 12:11 PM.
 
Old 01-09-2013, 01:07 PM   #7
rootaccess
Member
 
Registered: Mar 2012
Posts: 311

Rep: Reputation: Disabled
I have the e-book. I was implying about the physical book. Sometimes I am away or don't feel like sitting on a chair just to read. I can't buy every physical book because that'll add up.

Also was considering the bash cookbook which seems pretty in-depth. 2007 edition
 
Old 01-09-2013, 03:41 PM   #8
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by onebuck View Post
there is too a cool epub book for free somewhere, gnu, oppen source epub about bash
 
Old 01-09-2013, 04:07 PM   #9
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
Nice post

Last edited by jmc1987; 01-09-2013 at 04:14 PM.
 
Old 05-31-2013, 10:59 AM   #10
Kallaste
Member
 
Registered: Nov 2011
Distribution: Slackware
Posts: 363

Rep: Reputation: 85
Thank you, this is very nice.
 
Old 05-31-2013, 11:01 AM   #11
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by BloomingNutria View Post
Thank you, this is very nice.
Why not coding in C? It is also very simple and more powerful
 
Old 05-31-2013, 11:31 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,927

Original Poster
Blog Entries: 45

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,

You can use a shell script to experiment before implementing a high level language program. Most times you will layout the problem and align task(s) requirement(s) then experiment via a simpler script using available commands.

Sometimes you won't even need to move to 'C' or other language to implement a simple task. Of course if the task is time restrictive then a program in a higher level language would/could be used.

More than one way to skin a cat!
 
Old 05-31-2013, 12:20 PM   #13
Kallaste
Member
 
Registered: Nov 2011
Distribution: Slackware
Posts: 363

Rep: Reputation: 85
Quote:
Originally Posted by Xeratul View Post
Why not coding in C? It is also very simple and more powerful
I do code in C, and I appreciate it's power. But shell scripts are very prevalent throughout the Linux ecosystem, and it is helpful to be able to understand them so you can modify them and write your own when necessary.
 
Old 05-31-2013, 04:17 PM   #14
WHITE_POWER
LQ Newbie
 
Registered: May 2013
Posts: 8

Rep: Reputation: Disabled
I know most of the stuff already, but I did picked up some new things mostly in part II
 
Old 10-04-2013, 08:48 AM   #15
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
@EVyshnavi
your posts are way off topic

but to answer your question,
you need to do a couple of things
first find out where olsrpkt.h is , then find out what references it in code

to find the file

Code:
find . -name olsrpkt.h
to find it in code
Code:
grep -r -n olsrpkt.h *
the -n will also display the line number
Warning:
What follows is not real...
it is just an example of one way to 'fix' it
you need to use some of your own brain power to achieve results

now, let us assume you find the file in
./somedir/another/include/um-olsr/olsrpkt.h ( I made it up )
and your 'code' is
Code:
#include <olsrpkt.h>
change it to
Code:
#include <um-olsr/olsrpkt.h>
you could do that with sed
Code:
for i in "$( grep -rlz olsrpkt.h * )";do sed -i 's#<olsrpkt.h>#<um-olsr/olsrpkt.h>#' "${i}"';done
or, if just one or two, just use vim to 'jump' to the line
Code:
vim path/to/file +<lineNumber>
or use whatever editor you are comfortable with ( well, not notepad as it will 'messup' the end of lines.. )
 
  


Reply

Tags
bash, environments, programming, script, shell



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Scripting the Linux desktop, Part 2: Scripting Nautilus LXer Syndicated Linux News 0 02-17-2011 04:02 AM
bash shell script read file word by word part 2 justina Programming 7 01-25-2011 01:19 PM
LXer: 8 More Bash Tips for Working Faster With the Shell (Part 2 of 2) LXer Syndicated Linux News 0 12-23-2010 12:20 PM
LXer: 10 Bash Tips for Working Faster With the Shell (Part 1 of 2) LXer Syndicated Linux News 0 12-20-2010 01:50 PM
bash shell scripting - && and || gui10 Programming 10 12-15-2001 03:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration