1,892 Topics

Member Avatar for
Member Avatar for pinkfloyd

Hi all, I am using an if condition to compare the word count of a file to be equal to 21.If the file is equal(having 21 words),it is working correct.The problem is that if the file is having different word count than 21 also it is going inside the if …

Member Avatar for pinkfloyd
0
77
Member Avatar for pinkfloyd

Hi gurus, I have a script like this. echo "$file1 does not exists " | mail -s "No File found for $file1" [email]floyd@gmail.com[/email] It is sending the mail.But subject part is not coming.Only the content is coming($file1 does not exists ).Can anyone help me out? Floyd

Member Avatar for eggi
0
97
Member Avatar for yabai1974

I got a simple script if/else script working to check if a process is running and then email if it is not running anymore. My scenario is that I need to make sure the process is always running. Instead of running the script via cron I think it is better …

Member Avatar for Salem
0
225
Member Avatar for Trekker182

What's the best command and line options to use if I'm working with a text file that has spaces pretty much inside each description, field? They are not all uniform in each column and I need to extract them. I've already got rid of the tabs with the tr command …

Member Avatar for eggi
0
102
Member Avatar for babusek

[COLOR="Green"][/COLOR][B][/B][B]HI Folks[/B] This is Question seems like scrap but look into this .. I have several files in a directory(Ex:c:\dir\) now i have to remove the First 3 Characters from the File names in that directory. Using any unix command .. Test Case 1: C:\dir\ 123file.txt 456newfile.mp3 57575unixfile.dat trarruniing.txt After …

Member Avatar for eggi
0
167
Member Avatar for uravikishore

Hi I have server which is hosted in some other location, every day we have incremental backup and every week we have full backup done in the server itself, I need to copy (automate) all backup to my local server.. So I configured ftp server in my local server, now …

Member Avatar for uravikishore
0
121
Member Avatar for gamegod007

The task is i have a folder which has some text files i need to write a shell script which takes this folder as input and in the out put it should give me the filenames,lastmodified date,and the lastline in each particular file help me asap

Member Avatar for noobguy
0
126
Member Avatar for ajay23

Hi all, I am new to shell script. I'm currently running a java application using shell script. When i'm running the java applicaton i need to print all the System.out.println() statements in a file. I don't know how to implement it.. Can any one help me on this. Thanks in …

Member Avatar for eggi
0
69
Member Avatar for neclark2

Hi, So apparently every copy of windows comes pre-installed with a command-line ftp client that can be started by running 'ftp'. However, on the computer I actually need to use this command on, I seem to be missing the client because when I try to do this I receive an …

Member Avatar for eggi
0
85
Member Avatar for Robert72

I'd like to write a shell script that'd parse data from a pipe and then ask the user questions. ie: [code]echo "Ann Bob Charlie" | checkuser.sh checkuser.sh starting Ann is OK. Bob is not in the system. Add Bob? (y/n): [/code] I know a couple ways to read from a …

Member Avatar for JeoSaurus
0
155
Member Avatar for allorehedadem

Good evening , I found a good source of [url=http://www.prcrossing.com]pr jobs and public relations jobs[/url] called [url=http://www.prcrossing.com]PRCrossing[/url]. What is interesting is that is that [url=http://www.prcrossing.com]PRCrossing[/url] consolidates all of the [url=http://www.prcrossing.com]public relations jobs and pr jobs[/url] from other job boards and employer websites and puts them all its site . I …

0
39
Member Avatar for man5237
Member Avatar for eggi
0
264
Member Avatar for amit_s

Hi, I need to download email attachments using shell scripts. How to achieve this as I am a newbie in Linux/Unix environment? Thanks & Regards, Amit.

Member Avatar for eggi
0
74
Member Avatar for shwick

Running ubuntu 8.04 I built this off of the tripwire daily cron script. I'm trying to check the number of violations. There's a problem when $tripResult is instantiated with the tripwire report- it doesn't have any newline characters. This causes grep to not get the line with the number of …

Member Avatar for shwick
0
137
Member Avatar for born4unix

Hi, I want to find out files which were created,modified, accessed on specified date say "1 Oct 2008" and after that on file system level. can u please suggest me how to find that ?

Member Avatar for masijade
0
60
Member Avatar for evios

Hi to all the experts here, I am a true newbie on bash script and I have a couple of questions need to seek help: 1. What does "safe" delete command script means? I am confused with this statement: Write a "safe" delete command script. Filenames passed as command-line arguments …

Member Avatar for masijade
0
120
Member Avatar for Jaoqua

I am trying to dynamically create some shell script and run it (but don't know how!). I want to read in a string from a file (e.g. '[icode]echo $myvar[/icode]') then run that string (and, yes, myvar IS an existing variable). Can it be done? I have thought about writing it …

Member Avatar for eggi
0
86
Member Avatar for lmrd

Hey all. I have an interesting problem. I have a file with a ton of raw hex data in it. I need to convert it into human readable text for display on a web site. The problem that I am having is this. For some of the data I need …

Member Avatar for mittelgeek
0
139
Member Avatar for hbmarar

Something off the box: I got a log file of the pattern say like this : 19876 Exception happened at heylog.php. 19878 Argument missing I need a shell script / awk which should get the file, read the line and should get me the line number displayed with that message …

Member Avatar for eggi
0
149
Member Avatar for KarthigaB

Hi All, I have some log messages and sysout statments in my java code. I am executing my code through a shell script. I could able to see all my sysout statments since I have redirected stdout message to a file. Now I need to see the log messages to …

Member Avatar for Salem
0
95
Member Avatar for camila22

Hi there, sry all for my bad english i have this script but need to modify something if anyone can do it for me , this script need to start it in my linux box in process to monitor and when user deplete CPU or MySQL or something in (10%) …

0
45
Member Avatar for phynias

i have a modsecurity log that i want to pull a couple things from. here is an example line [05/Mar/2008:12:50:07 --0800] [[url]www.mydomain.com/sid#1ef44178][/url][rid#2042fa58][//member/index.php][2] Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/usr/local/apache2/modsec/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] so i want to …

Member Avatar for manik007
0
129
Member Avatar for jesseb07

hello, I wrote an expect script to automate ssh commands, and it was working, but for some reason it's not anymore. Just to make sure I didn't do any weird changes that I didn't notice, I tried several of the dozens of such scripts that are online, and for some …

Member Avatar for jesseb07
0
126
Member Avatar for bmead

Howdy, I'm a total newbie to scripting and I can't figure out the proper syntax to shell script a for loop for the following scenario: I have a directory of symbolic links to backup log files. I want to loop through the dir to cat the last 21 lines of …

Member Avatar for bmead
0
107
Member Avatar for rast1979

Hello I am trying to use the find command to search for the last files modifyed under certain directory Example: #find /tmp -mtime -1 find all the files modifyed from 1 hour ago The question is: Somebody knows hou can I do the same but using minutes or seconds instead …

Member Avatar for rast1979
0
133
Member Avatar for Gresakl

I'm working on a bit of homework and I don't need someone to do it for me but to help out with this portion. The rest of it is pretty easy to manage since I already have it mostly done but right now I can't figure out how to get …

Member Avatar for JeoSaurus
0
119
Member Avatar for neclark2

Hi, As the title suggests, I am completely clueless when it comes to shell scripts. However, I am in a position where I need to write one so I thought would ask for some help. What I need to do is dump every database in my instance of mysql into …

Member Avatar for JeoSaurus
0
157
Member Avatar for Clockowl

Does anyone know if it's possible to create a shellscript that knows when it's fopen()ed? So when any process fopens() it, it can take an action? Thanks in advance,

0
111
Member Avatar for Duvva

Hi can anyone helpme out in writing a batch file to delete archived log files. The batch file should delete the files in those folders that meet the criteria(files older than 3 months)and if all the files in the folder are deleted then the folder itself should be deleted.

Member Avatar for masijade
0
60
Member Avatar for yair7190

hi everyone, im trying to write a shell script that calculates memory usage of several processes (i basically run bash several times). here's the script: [code=bash] #!/usr/bin/bash memUsage=`ps -ef | grep bash| awk '{sum+= $2}'` echo $memUsage if $memUsage>130000000000000 ; then echo "mem usage exceeded" else echo "mem usage normall" …

Member Avatar for ghostdog74
0
120
Member Avatar for jasminselvaraj

Hello all, I have one shell script that takes the filename for processing as an argument. for eg. ./BulkEdit.sh SampleFile.xls. In the script it reads the filename from "$1" and does the processing of that particular file read from command line. If i have space character in the file name, …

Member Avatar for radoulov
0
147
Member Avatar for choco4202002

how to find all of the IP addresses in any and all of the files under /var/lib/output/*, ignoring whatever else may be in those files? now i can assume anything in those files.....can some one get me started on this. Now i know that the basic logic in this is …

Member Avatar for JeoSaurus
0
87
Member Avatar for Bavananth

Hello experts ! I'm a newbiee to this shell scripting! I try to write a "diff" kinda script which compares two text files and echos the differences. The only different is, my script doesn't care about the character "x" in the first file , being replaced with any other character …

Member Avatar for Bavananth
0
118
Member Avatar for mashimaro

Hi, I've got 2 problems with sh: 1) I have a list of logins, seperated by a space (in a logins.txt file, like so: login1 login2 login3). I'd like to display those login names which are online AND on that list. So I made a list of those online: users …

Member Avatar for Salem
0
113
Member Avatar for Luckychap

Hi all, I am very new to Unix. Please help me to write a script. Here is the discription of what the script should do: The script won't need to be horribly complex; it's to check to see if the hawkagents(a process) on a server have been restarted since the …

Member Avatar for Luckychap
0
153
Member Avatar for a.kris

Hey guys .. I am pretty new to Shell Scripting. I was hoping if some one could help me out with my problem. I am going with a tutorial for shell scripting. While executing some of the programs and commands I am getting errors. I have also checked other sites …

Member Avatar for eggi
0
203
Member Avatar for dotmac

Hello fellows, I'm on Mac OS X and have the following problem: Using a common cleanup script I got rid of useless localizations, keeping all the english files: [CODE] find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' \) -and \! \( -path '/Library/Receipts/*' -or -path …

Member Avatar for eggi
0
293
Member Avatar for megladon

Hello All, set -x is useful for me to debug my shell scripts but is there any way to make it write to a file instead of it writing to stderr ?? I do not want to have to do an , [code] exec 2> logfile [/code] to retrieve the …

Member Avatar for eggi
0
94
Member Avatar for Eilya

Hi friends, I want (a C++ code) to hide a process in kernel 2.6, I don't want monitoring even in /proc. please help me. Regards, Eilya

Member Avatar for eggi
0
198
Member Avatar for i.linus

Guys, I am new to shell script, and want to learn more about it. i have got one script to report on status of ADSL connection. i can understand half of it (or less then half). can you guys please help me out in this. Here is the script, ------------------------------------------------------------------------------------- …

Member Avatar for Salem
0
174
Member Avatar for ryanique

Hello Experts, I am new at this and need some help. I am looking for a delete command that allows me after I grep for the hostname to delete all the lines between two characters. for example I want to delete the first line all the way up to the …

Member Avatar for eggi
0
69
Member Avatar for pallavisinha

hi, I am new to scripting. I want to change username and password of a user 500 times. I dont want to use except .....please somebody help. Thanks in advance, Pallavi

Member Avatar for pallavisinha
0
97
Member Avatar for dave_nithis

:) Hi all Am writing a shell script like this: java file1 > output.txt and the output output.txt is used in a html page. Now coming to my problem: This script should run every one hour and when user views the html page,it is showing the partially written output.txt file …

Member Avatar for Salem
0
85
Member Avatar for FractalizeR

Hello. I have the following problem with bash code: [CODE=bash] function fl1_load_modules_and_get_list() ........... for module in $FL_MODULES_TO_PROCESS do source "${FL_MODULE_DIR}/${module}/module.sh" done ........... } function fl1_handle_install { local FL_MODULES_TO_INSTALL=$(fl1_load_modules_and_get_list $1) #Executing pre-install routines for module in $FL_MODULES_TO_INSTALL do fl_mod_${module}_pre_install done } [/CODE] First function is called inside the second one. First …

0
62
Member Avatar for pritishs

Here file abc.txt contents name designation salary ----------------------------------- pritish am 15000 animesh pm 20000 asutosh ceo 30000 Write a shell script to find the name whose salary greater or equal t0 20000

Member Avatar for dave_nithis
0
66
Member Avatar for FractalizeR

Hello. Is there a way in bash to call a function by it's name? For example, I have: MODULE_NAME='test' FUNCTION_NAME='execute_run' How do I call the function with name test_execute_run? I need this to solve the problem of modularizing my bash script. Thank you.

Member Avatar for FractalizeR
0
92
Member Avatar for kmarty009

All, I am relatively new to bash scripting. I have been a Windows Admin for 10+ years and script various tasks in windows, but Linux is a different story. So any help you can provide is greatly appreciated. What I need to do is restart the sshd service on 30 …

Member Avatar for eggi
0
116
Member Avatar for yair7190

hi everyone, im searching for a way to insert several values i get from a command [top |grep root |awk '{print $10}'] to a variable, so that the variable will contain the sum of all values returned. (trying to calculate MEM usage by all root processes ) can anyone help? …

Member Avatar for ghostdog74
0
151
Member Avatar for nihao

Hello everyone: I want to change this date "12 Apr 2006 23:35:47" into "2006-04-12 23:35:47",I have tested lots of parameters of the command "date",but it still not execute UNDER FreeBSD,pls help me,thanks!

Member Avatar for dklima
0
560
Member Avatar for georgegao111

my script try to combine a variable(include space) with another variable, and put them together as a command's parameter, I put "" for the variable which includes space, but it is always broken into two strings and make the command fail. [code] bash-3.1$ ./space.sh ./param -J "t space" sleep 10 …

Member Avatar for georgegao111
0
177

The End.