LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is scripting worth learning (https://www.linuxquestions.org/questions/linux-general-1/is-scripting-worth-learning-3969/)

ChimpFace9000 07-05-2001 02:39 AM

Is scripting worth learning
 
Question 1:
Is learing to write scripts an important part of linux, or should i just try and learn to program linux only.

Question 2:
Is there some command that adds text to the end of a file?

Question 3:
How do i echo a new line. Like echoing the characters 10 and 13 for carriage return and line feed?

mcleodnine 07-05-2001 03:23 AM

Personally I feel that scripts are an integral part of sysadmin skills. Most (all?) distros use scripts to perform the startup and cron duties, so knowing what's going on will be a benefit when you want to make some changes.

Part 2 of your question. In bash shell use the '>>'.
Code:

echo "the stuff you type" >> yourfile

jharris 07-05-2001 03:52 AM

Re: Is scripting worth learning
 
Quote:

Originally posted by ChimpFace9000
Question 1:
Is learing to write scripts an important part of linux, or should i just try and learn to program linux only.

Scripting is a type of programming, its just interpreted (sp?) instead of compiled, however the term 'scripting' covers a lot of different languages and shells! You could script using bash, tcsh, ksh, Perl just to mention a few... I as mcleodnine's said being able to write scripts without too much effort can be a serious part of sysadmin and can make you life a lot easier.

Quote:

Originally posted by ChimpFace9000
Question 3:
How do i echo a new line. Like echoing the characters 10 and 13 for carriage return and line feed?

I think that just using echo with no parameters will put a newline on for you (assuming your shell scripting). UNIX system only use a line feed, no carriage return like DOS does, thats why when you load a UNIX text file into Notepad it doesn't like it, and why sometimes you'll load a Windows text file into a UNIX editor and find a ^M on the end of each line, these are the carriage returns being displayed.

cheers

Jamie...

beta 07-05-2001 04:02 AM

I think when you learn how to create scripts it will be very useful! It makes most things easyer, but learn is not the right word. Just play a bit with script-files.


All times are GMT -5. The time now is 06:15 AM.