Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

-1
votes
2answers
258 views

Where can i find the advanced home dir backup scripts

Is there any script for linux which can backup the home directories and mysql databases in separate directories . i mean best of all scripts which is general and any one can use that one. By backup i ...
0
votes
3answers
124 views

listing file with for loop using array and if

I've written a script to check files in different directories and want this script to show me error in case a file does not exists. But It show me Both ERROR and NO ERROR due to loop. ow to adjust so ...
1
vote
2answers
48 views

echo with each parameter on its own line

I would like an output similar to ls -1d, but I don't want to check if each file exists. I would prefer to just list the files. I could use echo, but echo only puts a space between files. How can I ...
0
votes
1answer
1k views

creating folder with date range linux shell or C

Hi i need to create a series of folder with a range of date for exmaple createdir 2010-02-02 2010-02-05 will create : 20100202/ 20100203/ 20100204/ 20100205/ What the best way to do this ...
0
votes
1answer
436 views

Taking BusID output from lspci and storing in a variable

I am trying to get the BusID's of each video card stored in a server and putting them in a variable each to be used for an input to a simple find and replace perl script. How would I go about getting ...
0
votes
1answer
271 views

How to append xml data inside xml file with shell script?

script.sh #!/bin/sh mysql -u root -pmysql --xml << eof SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb" FROM ...
0
votes
2answers
596 views

Convert string to xml in shell script?

I have written a script which is fetching data from database. Now I want to enhance that script to create a xml file with data which is return by database. How may i convert that string to xml file ...
0
votes
3answers
3k views

How to run mysql commands through shell script?

mysql -u root -pmysql; SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb" FROM information_schema.TABLES WHERE ...
4
votes
2answers
5k views

Does mysqldump return a status?

I am creating a script that backups a mysql db using the mysqldump utility. I am writing this script in the shell "sh". I would like to capture the output status of mysqldump in the script (i.e. if ...
2
votes
4answers
739 views

how to change permissions of specific file type

file * | grep 'ASCII text' | chmod -x chmod: missing operand Try `chmod --help' for more information. The above command gives me error.Basically I am trying to find all the files whose type is ...
0
votes
1answer
380 views

Move all images in folder to subfolder, and update all references to those images to their new location?

I have a folder which contains a ~50 text files (PHP) and hundreds of images. I would like to move all the images to a subfolder, and update the PHP files so any reference to those images point to the ...
1
vote
2answers
597 views

delete string recursively from all index.php files in a home folder

We need a shell script to find and replace a piece of injected code within all index.php files within a /home folder
0
votes
2answers
119 views

How To Generate A Report Of All Messages Triggering A Specific NDR

CENTOS 5.x | Sendmail Hello All, I hope this is a simple question. =) I need to generate a report summary of messages that triggered a specific DSN code. For example: Jan 11 07:43:34 ...
5
votes
2answers
4k views

ssh fails to execute remote command when run from cron bash script - works from CLI

I have a script, written in bash, which runs from cron. One of the first things it does is SSH to a remote host and retrieve a list of files in a directory. Everything works fine when run from the ...
3
votes
3answers
6k views

control a bash script with variables from an external file

I would like to control a bash script like this: #!/bin/sh USER1=_parsefromfile_ HOST1=_parsefromfile_ PW1=_parsefromfile_ USER2=_parsefromfile_ HOST2=_parsefromfile_ PW2=_parsefromfile_ imapsync \ ...
2
votes
2answers
481 views

What is the best Android phone for remote ssh administration/scripting? [closed]

I've got a Moto Droid that I use with connectbot for remote admin on Linux webservers. However, I'm wondering if there are any Android phones out there with better hard keyboards for use with ...
2
votes
2answers
2k views

What is wrong? “Syntax error: unexpected end of file”

I keep getting this error, do you guys know what is wrong? rapache is an alias for restart apache mugbear:/usr/bin# cat /usr/bin/mkdomain if [ -d ...
0
votes
3answers
260 views

How can I make this script better?

I was wondering if there is a better way to create a file other than appending each line to the file. I did it this way so I can preserve readability, however, there is no indentation. Is there a way ...
0
votes
5answers
4k views

want user will logout from shell on exit of bash script

I want, when a linux user exits from a shell script, that it also logs out from the bash shell. Is this possible?
0
votes
3answers
2k views

Need script to redirect STDIN & STDOUT to named pipes

I have an app that launches an authentication helper (my script) and uses STDIN/STDOUT to communicate. I want to re-direct STDIN and STDOUT from this script to two named pipes for interaction with ...
3
votes
1answer
4k views

How can I replace line #6 in a text file in a bash script?

I have a text file that is generated by 3rd-party software as part of a build process. I want to replace one specific line - in my case, line 6. How can I do this in my bash script? I suspect sed is ...
4
votes
2answers
4k views

Unix separate multiple commands which has '&' (execute in background) in the end

To separate regular commands in Unix is to put semicolon in the end like this: cd /path/to/file;./someExecutable; But it seems not working for commands like this: ./myProgram1 > /dev/null & ...
2
votes
4answers
1k views

How to lock user in a shell script program?

Let's say I have a Linux OS without desktop environment. After the PC finish boot up, it will directly show the shell terminal to the user. I plan to write a shell script program and make it ...