Questions tagged [shell-scripting]

Programming in an Interpreted language executed by a running Shell

Generic programming in an Interpreted language (as opposed to compiled) executed by a running Shell. Sometimes referred to as "Glue Code" due to the practice of managing the execution and output of one or more compiled binaries and passing said output to another series of commands.

621 questions
0
votes
2 answers

linux + bash + export parameters in to a new file from data file

I have Linux machine red-hat 5.1 and I ask the following question my target is to create new output_file.txt file from answer_file.txt according to data_file.txt as we see here I run first the data_file.txt and export all parameters from the…
Eytan
  • 611
  • 6
  • 13
  • 27
0
votes
2 answers

grep from file based on the integer value

How can I get details of the page that taking more than 10000 sec.…
Arun
  • 3
  • 1
0
votes
1 answer

Monitor USB port without physically plugin hard drive

I have to design a program to monitor USB ports of a linux server to detect when an external hard drive is plugged in and removed. Now I have one confusion in my mind about it. I have my own VPS. so if i design a program then how can i check it…
Kashif
  • 493
  • 9
  • 20
0
votes
1 answer

rc.local is not executed on bootup ubuntu

Im on Ubuntu 10.04. I want to execute script on system boot. I added it to rc.local. If I execute rc.local manually it works fine. If I boot system in recovery mode(2nd string in boot menu) it also works fine. But if I boot normally it is not…
Alexander
  • 125
  • 4
0
votes
2 answers

MySql information_schema error - Lock Tables

I have written a quick shell script to take each backup of MySql database & that works good. I was using the same scripts for all mysql servers tool, I have installed it on ubuntu 10.04 server. Now the problem is when run the shell script I am…
Caterpillar
  • 1,132
  • 2
  • 23
  • 47
0
votes
1 answer

process in the background

I have loop in shell script and it takes time process only a few files in the list. How do I push the process in the background and select the next file while the first file is still being processed? for newfile in `ls new*` do time…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
0
votes
3 answers

shell script + match MAJOR and CRITICAL strings from log file

I need to match lines that have MAJOR and CRITICAL strings that comes after the word ERROR:< any integer number > please advice how to do that with one awk or sed command? more HW_Log.txt CHK_HW ERROR:0 INFO self_monitor …
Eytan
  • 611
  • 6
  • 13
  • 27
0
votes
3 answers

rsh for windows 7

I am looking for rsh client for windows 7. It should be GNU. I also can't run setup on that machine, so this file must be copied. Reasons: I had a windows XP batch file with rsh commands that executed commands on a remote machine. I am not allowed…
Doron
  • 21
  • 4
  • 10
0
votes
1 answer

Running root script upon ssh'ing as a particular user, but not upon standard login

I would like to do the following : If I login as user ABC via the login screen, do nothing. However if I ssh as ABC, then I want to run a root script, without being prompted for roots password, and without having to store roots password somewhere…
artella
  • 1,009
  • 2
  • 10
  • 6
0
votes
2 answers

How to fetch lines between two strings using shell script?

How to fetch lines between two strings using shell script? For example I am having a file called file_text.txt as below. MEDIUMINT CREATE ( MAXVALUE MEDIUMBLOB MEDIUMINT MEDIUMTEXT MIDDLEINT ); MINUTE_SECOND MINUTE_SECOND CREATE…
Aha
  • 409
  • 3
  • 8
  • 18
0
votes
4 answers

How to determine the block device booted from in a shell script?

I'm crafting up a shell script (to be called by cron) that runs smartctl on the booted disk on a weekly basis. Is there a fairly universal way to determine what the boot block device is (IE - /dev/sda, /dev/hdb, etc)? The expected install would be…
Chris Weiss
  • 25
  • 1
  • 6
0
votes
2 answers

OS X Server script to archive (or empty) a users mailbox every morning

I have a requirement (SpamAssassin 'training') to archive (or delete) two user's (users are junkmail and notjunkmail) inboxes at a given time every day if there is anything in them. Can anyone help me with a script to do such a thing and where to…
Meltemi
  • 579
  • 2
  • 11
  • 24
0
votes
2 answers

export command within shell script

When I use export command at command prompt, it works as expected. But it does not work from shell script. [root@server shantanu]# export myip=10 [root@server shantanu]# echo $myip 10 [root@server shantanu]# vi myip.sh #!/bin/sh export…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
0
votes
2 answers

Highlight code line by line

Following is the shell script that is expected to pick one line at a time from a given file highlight it. #!/bin/sh > myhighlight.txt file='to_study.php' cat $file | while read -r myline do export $myline php -r 'highlight_string("$myline");' >>…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
0
votes
1 answer

window shell (batch) script to list files changed since yesterday

Any example of windows xp dos script(.bat) that when run will iterate all subdirectories and list all files that have date updated since yesterday time?
user41999
  • 117
  • 1
  • 6