General :: System Administration Scripting - Write Very Basic BASH Shell Scripts

Jan 10, 2011

I'd like to know some good resources, links, e-books to learn basic Linux system administration scripting. I know how to write very basic BASH shell scripts so I'm still at beginner level. There are so many docs out there that I'd like to narrow down people's opinion's on the best easy to understand resources that are available. Eventually I'd like to learn basic PERL as well.

View 3 Replies


ADVERTISEMENT

General :: Write Either PYTHON Or Bash Shell Scripting?

Jun 4, 2010

I do not know how to write either PYTHON or Bash Shell Scripting. I am to learn one for Linux Administration purpose. Which one will you recommend for a Linux Admin/Eng environment?

View 4 Replies View Related

General :: Bash Shell Scripting Request?

Feb 27, 2011

I am working on a simple script that should take two command line arguments, a [number] and a [name]. The first thing the script should do is check to make sure that no more and no less than two command line arguments have been entered when calling the script - an error message should be delivered if the condition is not true.

If two args have been entered, then the message 'processing "scriptname"' should appear, where scriptname is the name of the script being called. The script should then write to the screen "Hi [name]!", and should write this phrase [number] of times. For example, the command $ myscript 2 joe would produce the output: I have read the manual many times looking for examples, and I am very close by virtue of my own efforts. Further, I have searched these forums and others for good examples, which have also gotten me very close. Still my script is not completing the objective, and I am wondering if someone could point me in the right direction. Script:

[Code]...

View 13 Replies View Related

General :: Make Simple Website In System Using Bash Scripting?

Apr 3, 2011

How to made a simple website in linux using bash scripting.

View 3 Replies View Related

Server :: Bash Shell Scripting For Samba Configuration?

Apr 5, 2011

vi /etc/samba/smb.conf
[samba test]
comment = client
path = /opt/apps/deploy/websites
public = no
writable = yes

[Code]...

Using the bash shell script the above given samba configuration,the script should automatically add these above given entries in the /etc/samba/smb.conf.can any one help me how to edit the file add entries in the config file using shell script.

View 10 Replies View Related

Server :: Bash Scripting Sending Write Error - Broken Pipe

Apr 19, 2010

I move a page from a server in SuSe to Debian and this script was working well but when I move the page to a Debian base server it is sending in the logs the following message:

cat: write error: Broken pipe, referer: [URL]

The cgi does the following, read a db file plain text that repeat each 15 lines an information where to look the seraching info. if it is there sends to the output the 15 lines block. but it was not sending errors in suse distro, does anybody knows why the cat's line are sending "cat: write error: Broken pipe," if I am not writing or making a pipe with ">" to none file.

View 8 Replies View Related

Fedora :: Shell Scripting / Bash Error Est.sh: Line 9: Kill: (20831) - No?

Jun 11, 2010

I was giving the found the following shell script. I was told it was suppose to ensure only that only one script of Test.sh can run..

However, I get it looks like it has a error when i run it... As i get Test.sh: line 9: kill: (20831) - No such process

what is going on in this script can someone explain it to me... I thought it suppose to work like a singleton for my script creating a file .run-test-sdolan. However, i don't see how or where .run-test-sdolan is create?

sdolan@staging:$ vi Test.sh
#!/bin/sh
MYDIR=`dirname $0`
CONFDIR=$HOME/
code....

View 4 Replies View Related

Fedora :: Create A Shell Script File With Two Functions - Bash Scripting & /etc/bashrc

Oct 6, 2010

how come I can create a shell script file with two functions, I can execute the file, but when running declare -f, the functions are not on memory, and when invoking the function bash returns invalid. In the other hand, I can copy & paste the two functions at the end of my /etc/bashrc file.... then I can called the function by name.... and the commands within that function run on my session. here is a print of all my bash packets:

[Code]....

Does Fedora has restrictions on shell scripting? I haven't touch bash in seven years, so if things have change on it I'm behind on it, and sorry for my ignorance.

View 1 Replies View Related

Programming :: Shell Script And Administration Of A System - Change Or Set The IP Address And Subnet Mask

Aug 26, 2010

tasks of an administrative level that we can use Shell Script to automate them. It's a kind of homework for me to figure out how to automate those tasks. Using PHP and Shell Script design and develop a Web Interface to change or set the IP Address and Subnet Mask of the UNIX / Linux System. The related services must be restarted automatically for the new IP Address and Subnet Mask to take effect. No user name and password should be asked for when using that Web Interface. How would you do it?

View 10 Replies View Related

Programming :: Bash Shell Scripting / Using The Sort Command To Sort The Top 5 CPU Processes?

Feb 28, 2010

What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?

View 2 Replies View Related

General :: Bash - Rename Files With Spaces Using System Shell?

Jun 8, 2011

I named a number of files with spaces in them, and I want to replace the space with "_". However, every time I write a command in the shell with the file name (eg "Spring 2011"), the shell doesn't recognize the file or directory. What can I do about this? Is there any way to use the unicode character for a space?

View 5 Replies View Related

Programming :: Which Scripting Language To Learn For Administration?

May 26, 2011

Which scripting language to learn for Linux Administration? Python, Ruby, Perl, or PHP?

View 7 Replies View Related

General :: System Bash Shell Copy Previous Lines (not History) With Keyboard?

Jun 14, 2011

Is it possible to use the keyboard in order to select some text in the terminal windows that is not in the currently edited line? (for example, in order to copy part of previous command output).

View 3 Replies View Related

General :: What Is Shell Scripting?

Feb 15, 2011

What is shell scripting? what is 'bash'?

View 14 Replies View Related

General :: Basic Shell Codes Using C Language

Mar 10, 2010

I'm doing my project on shell designing, so can I know the basic shell (any shell in linux) codes using c language with few commands implemented on it.

View 2 Replies View Related

General :: Write A Shell Script Which Will Simultaneously Collect OS User Information And Write In An Individual Text Files?

Feb 17, 2010

I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.

View 8 Replies View Related

General :: Any Projects On Shell Scripting?

Dec 6, 2010

Just give me any project on shell scripting .. to start working on it and practice my self ..

View 2 Replies View Related

General :: First Line In Shell Scripting?

Feb 15, 2011

I am a bit confused with the first line while writing a shell script , if someone can please explain me the meaning of the first line " #!/bin/bash "the confusion for me is the # at the beginning , in shell scripting # means a comment. but in this case it loads the shell which the script must use,instead of commenting the line how is this possible. where is this defined , any particular file.

View 3 Replies View Related

General :: Global Expressions Using Vi And Shell Scripting?

Jul 29, 2010

I am trying to learn more about global expressions and how it is needed in changing stuff in vi and in shell scipting in general.My question is basic:

How can I add a " # " pound sign at the beginning of every line in a file. So if I want to remark out every line in a file, what would be the global expression for that? Is there a global expression cheat sheet?

View 4 Replies View Related

General :: Shell Scripting - For Each File In Directory

May 2, 2011

I am working on some homework, however i am not here to be spoon fed. I am trying to get the numerical modification date of each file in a folder. Ie lets say there is a file called bob and it was modified 2006-11-23. i want to get it into a variable as 20061123.

Now i currently have this code:

Code:

However for some reason my output is:

Quote:

See how the 2011 has been placed next to it? i ran it with -x and saw this:

Code:

However i do not know how to find a way around this?

View 11 Replies View Related

General :: Learn Shell Scripting And Came Up With A Lil First Script?

Jan 26, 2011

I am trying to learn shell scripting and came up with a lil first script that I could actually use.I have a basic shell script and all it does is run:

sudo apt-get update
sudo apt-get upgrade

So basically just a shell script that updates your packages. NOW, my question. I made another shell script that makse a bit of a menu and asks what you wanna do, 1 to UPDATE or 2, to CLOSE. How do I make it so when they enter 1 it runs my update.sh ?

View 6 Replies View Related

General :: Basic Bash Filename Escaping ?

Nov 18, 2010

What I have done wrong with my escaping here:

Code:

The original filename is:

Code:

View 4 Replies View Related

General :: Write A Shell Script Instead Of Shell Function?

Apr 27, 2011

I would like know when it is necessary or advisable to write a shell script instead of shell function ?

View 3 Replies View Related

General :: What Is Purpose Of Bash Scripting?

May 15, 2010

What is the purpose of bash scripting? Is it just for file manipulation?

View 4 Replies View Related

General :: How To Set Incrontab In Bash Scripting

Mar 7, 2011

I have a question;

Is it possible to set incrontab in bash script? I tried to set normal crontab and it works like a charm but unfortunately not "incrontab"

I have two bash files; test-incrontab.sh and addlinetocrontab.sh and here are the contents of these files respectively;

Code:

Code:

As you can see there are two enteries in each file. One for normal crontab and other one for incrontab. When i run "test-incrontab.sh" like following;

Code:

crontab works perfectly and i can see cron job set but for incrontab it just does not work. No error either!

I am only getting this back "table unchanged"

View 2 Replies View Related

Software :: Export A Variable To Parent Shell In Shell Scripting?

May 21, 2009

Is there a way to export a variable to parent shell in shell scripting ?

View 3 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

General :: Incrementing Array Element In Shell Scripting

Jun 23, 2010

ch[1]=0; ch[2]=0; ch[3]=0; ch[4]=0; ch[5]=0; ch[6]=0; ch[7]=0; ch[8]=0; ch[9]=0; ch[10]=0;ch[11]=0; ch[12]=0; ch[13]=0; ch[14]=0; ch[15]=0 ch[16]=0; ch[17]=0; ch[18]=0; ch[19]=10; ch[20]=0;

I have an array ch and I want to increment each element in my array for the following if statement. I'm not sure I have the right array increment syntax but I have tried it in different ways ant it doesn't seem to work.

I tried ch[$1]++, ch[$1]+1, ch[$1++], ch[$1]+=1, ch[$1]=ch[$1]+1 none of these seem to work.
# while loop reading from read.txt for check list 1 - 15
for i in `seq 15`
do
a=`grep "${cl[$i]}" $file`
status=$?
if [[ $status = 0 ]];
then
echo -n -e "1 "
let ch[$i+1]
let k++
else
echo -n -e "0 "
fi
done
for l in `seq 20`
do
echo -n -e "${ch[$l]} "
done

View 2 Replies View Related

General :: Randomly Select Folder Using Shell Scripting

Jun 17, 2011

There are five folders in a folder and I want to select one randomly. I used this command:

Code:
rand1="${loc[RANDOM % ${#loc[@]}]}"

but it selects files too. I have no idea about this code even. I found it on a forum.

View 7 Replies View Related

General :: Shell Scripting Text File Creation ?

Feb 16, 2011

I'm just starting out with shell-scripting, but having a problem with making new text files with the touch or cat > commands.

What I've been doing is touch testfile1.txt

Also, I've tried cat > testfile1.txt (text)

Console reports "bash: text1.txt: No such file or directory. Consfusingly, it works fine in the home-directory. But if I move the file to where I want it, I can no longer view, edit, etc. it.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved