1,892 Topics
![]() | |
Hi All, I am new to scripting. I need your help to removing spaces from a string and assign them to different variables. Iwant to call script with one command line argument which is file name which containes different attributes their type and different values eg fdxE1ConfigAdminStatus int 1 2 … | |
I have a small server and want to ban ip address I get alot of spam from. I use fedora 4 with iptables, spamassassin, clamav, and psotfix. I get the line in /var/log/maillog that says: Jul 14 20:52:33 xkmail amavis[15966]: (15966-06) Blocked SPAM, LOCAL [127.0.0.1] [216.22.18.252] <ret@threecurtain.com> -> <miranda@xkmail.hopto.org>, Message-ID: … | |
Hi All, The following script checks whether the filename is correct then the script proceeds to check whether you have read,write and execute permisiions to the file and displays an approriate message. [CODE]#ss23 #usage ss23 echo "enter any filename \c" read fname if[!-z "$fname"] then if [-r $fname -a -w … | |
I have written a shell script for transfering files from ftp1 to ftp2. In ftp1 there can be any number of directories,For eg under sourdedir (mentioned below)there can be any number of directories eg /opt/lampp/htdocs/scrap/test1/ under test1 1.7505-----1.zip 2.2505------2.zip In each of the subdirectories there wilI have written a shell … | |
How to use mail in mks ? it gives not an internal or external command. can any one solve this problem Thanks Vishal | |
I have comma seperated values in a flat file, example below: [B]RStndrd,Mer,1902 PAR GRN,ParentGroup,[/B] I am interested in getting the third parameter from above, ([B]1902 PAR GRN[/B]) in a variable called MyID...i am using the command below to get the third variable [B]MyID=`echo $line|cut -f3 -d ","`[/B] but using the … | |
Hello all, new to this site and to scripting. I am trying to search for the line with "CALIBRATE" in a file, and remove the leading # from the line with the following lines: cat $F1 | sed -e '/CALIBRATE/s/^#//' > $F1 cat $F2 | sed -e '/CALIBRATE/s/^#//' > $F2 … | |
This is probably just due to my quotes, but I'm trying to get the following script up and running: This is my command line: find ./ -type f | xargs grep "#include <some.h>" | awk -F: '{print $1}' | xargs grep "#include <another.h>" I'm trying to find a nested header … | |
Calling All Shell Scripters, I am a web developer needing assistance from someone with shell scripting expertise. Does anyone have a unix shell script that can look into a directory and identify any "*.zip" files and ftp them to a remote server? Upon successful completion of the FTP transfer I … | |
Hello everyone! Below is a sample flat file (sampleflatfile.dat) i have on UNIX: [COLOR=#000000]AMPS,2324,Subscriber,Unknown,SingleDay,20070413,20070413,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]ALPEnt,4516,AllMember,Unknown,DateRange,20070411,20070419,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]AGLT,2156,Summary,Unknown,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]DUPP,2536,Yes,Unknown,[/COLOR] each line above represents a report to be generated...therefore, the content of the sample flat file above means we need 4 reports (because there are 4 line)... the file above … | |
I need a robust shell script fast and don't have time to learn how script it myself from scratch. Summary: An existing PHP Application allows consumers to place an order for a product and upload files necessary to build that product. These files are stored in folders on the webserver … | |
Hi all, Am having some weird problems with the Korn Shell that has left me puzzled for days... Consider having a line which resembles this in your script file: ssh username@host "command" ie. ssh rockysfr@localhost "ksh" This should put you in the ksh environment. Now, the strange thing is that … | |
Hi All Gurus, I am new to scripting.. and want to know what is the meaning of each non zero exit codes from 1-255. Please help. Thanks in advance Sandy_b76 | |
How can i get awk to separate the output with dashes? A simple awk '{print $1-$2-$3}' does not work. | |
I'm writing a Bash script to read from an input file and write my changes out to an output file. I'm using read and for some reason, it is stripping the leading spaces off of each line. I didn't see any flags in read to turn the stripping off. I'm … | |
[B]Hi everyone, What does this command mean? grep '^[a-zA-Z]' Cheers, [/B] | |
[B]Hi everyone, Is there any option for rm to remove a directory with no prompts?Actually I know about rm -r but by this option I have to answer lots of questions... Cheers, [/B] | |
I'm completely new to this and have fallen at the first hurdle.:( I'm only playing so its not urgent. Here is my little bit of code: #!/bin/ksh print Content-type: text/html print print '<pre style=font-family:Fixedsys>' [B][COLOR="Red"]gtacl -c 'files $usvol1.ssdxl' [/COLOR][/B]|{ while read line ;do print "${line%%=*}" done } print '</pre>' Don't … | |
Hello, I'm fairly new to Linux and have managed to make this script below work. Basically it gets my current external ip and emails it to me. It works great as a cron job daily but I was wondering if some of you guru's may be able to augment this … | |
Situation: I have a working shell script on our file server (OSXS Tiger) to connect to a workstation, which is using a portable home directory (phd), and rsync a user's MirrorAgent.log. I'm not that strong of a scripter, but I would like to add other workstations to this script as … | |
Hi, I'm trying to shell script crontab commands, so that users can execute those by keeping the script inside the sudo menu. Users need to do this since they have only sudo access. Our server env is set in such a way that only root users can run crontab utilities. … | |
How would you set the default umask value for normal users if you are working in a typical business company as a system administrator? and Why? Tell me what you think! | |
I need an awk script to do the following things, please help me. Here is a scenario. I have a text file which I usually be editing in NEDIT, I have to select the text (basically pair of points- like a 2 column data points) then through customised shell menu … | |
[B]Hi guys, I'm trying to write a makefile but it keeps giving this arror: ***missing separator. stop. Actually I start a new line with tab,but it seems there are some space chars there, I'm using vim,how can I start a new line with tab??? Thanks alot :) [/B] | |
hi there, i am looking for some sample shell scripts where i could run this shell scipt after my backups are done and are lying in the directory. what i want to accomplish is: to run the script after the backups are done and to delete the past tar files … | |
Hi, I have created a convaluted and hacked script here for comparing unix dates. Can someone help me use calc or date w/ julian param or something to look back a week, a month or even a year and compare dates or add/subtract the dates somehow in a shell script? … | |
I have a text file with hundreds of names i would like to search in the database, yet to perform this query the names have to be on one line separated by commas. the text file is as follows Mike Ralph Cindy Claire John the output i need is Mike,Ralph,Cindy,Claire,John … | |
Dear Experts, to give a better picture i will explain the directory structure first the files have the same naming convention and the only difference is the first letters which is the title of that account, there is a total of 210 files only the bold letters change for each … | |
Hi, I need some guidelines to start coding a shell script that will provide the administrator with the shutdown options : -shutdown -now shutdown -h ? -shutdown [time] , which i have no clue how to use a variable so the user can manually select a time to shutdown. -shutdown … | |
Hello, i'm taking my first class in linux and i am working on a script that will display 3 random number and display amount of jackpot, the script should act like a "slot amchine game". I have two problem one is the statement "You are a loser" is diaply even … | |
Hello everyone, was wondering if any of you might happen to know something that can help me. I've been searching the net for a way to get GNOME to change its resolution from a script. I can call gnome-display-properties but that pulls up a gui. Basically I am writing a … | |
Thank you very much for who can solve this bash script: "Create a bash procedure createdata that creates collections (directories) that that will have to contain a random number, comprised between 300 and 600, of binary files of dimension comprised between 10 Kbytes and 30 kbytes. Also the names of … | |
[B]Hi everyone, What does @ mean in shell scripts? Cheers, [/B] | |
Hi Guys, I am using a BASH script to add users to an ACL in the squid.conf file. Basically the script searches for a string and adds a variable to the end of the string like this: [code] cat /etc/squid/squid.conf | awk "/INTERNET/{ $0=$0 " $UNAME" } {print} " > … | |
Hi I am a new bee in Unix World. I need a little help regarding my problem. I want to swap two file which i will passing as command line argument. I can swap the two files but i am unable to check whether the file name passed in the … | |
Hi.. im a newbie in shell scripting, and also new in this forum.. i understand the command below is just reading from /etc/passwd and getting whatever in field 1 and 3 (which are username and userID) after the cut the format will be username:uid my guess,its making the array with … | |
hi, Is it possible to run a gedit command in the terminal that will create a text file automatically and save it in my desired file extension? For example, if I run: gedit file.txt by default, it will open a null document named file.txt. But all I want is to … | |
[COLOR=#000000]Hi Code gurus!!...my first post in this forums and I m new to shell scripting too!...I need a shell script to accomplish the below, any input will be greatly appreciated..[/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]Below is a sample content of a text file, [B]file1.txt[/B][/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000]AMPS,2324,Subscriber,Unknown,SingleDay,20070413,20070413,[/COLOR] … | |
Hi all, I am new in shell scripting and I would like to make a bash script which will inform me if one of my friend is already logeed in. If a friend is logged in I want to take as output USER1 : is in. else USER1 : last … | |
awk '{print NR SEP $0}' SEP="/ " exfile1.txt > try2.txt here is a awk scritp which copies the contents form one to anthor it works well, but how do I change it to copy the contents in to several files ? can any one help please | |
I'm trying to add a zero at the end of the data that start with 62018 (it will always start with 62018) UNB+UNOA:1+5030917029608:14+5000119000006:14+070509:0850+62018000100020[B][U][COLOR=red]0[/COLOR][/U][/B]++INVOIC any help would be appreciated. Thank you JG | |
Hi i'm using Cywin bash shell, I am trying to scan my entire hard drive for an executable that contains text references to an ocx called ezVidC60.ocx (it appears to be used by both malware and non malware programs, I need to work out which). In Windows the dll and … | |
Hello everyone, Given a list of output that looks like this (from NetBackup bpimagelist if any of you are familiar), I need to pick out the last full backup closest to the end of the quarter (3/30, 6/30, 9/30 12/31). 10/20/2006 21:24 INFINITY 146144 64213523 N Full Backup 10/13/2006 21:46 … | |
hey guys, can anyone tell me what's wrong with my code? im trying to test if the input ($no) is a number: [code] read no echo $no | egrep - c "^[0-9]*$" | wc -l > y [/code] y now should be 1 if the user enters a number but … | |
Hello Master Scripters, I am in scripting nursery and I am trying to write a script that will replace string a with string b. I can get my script to replace single strings with no problem, my issue arrives when one of my strings has two words. I am pretty … | |
Hi, I'm new to shell scripting. I need to make a script to add on to my cronjobs. The script must get the value of load average from my server and if its greater than 10 it should stop my apache service. I cant find a way to get the … | |
hey, guys im new to UNIX and i need help.. I need to write a script which will tell you if you entered an even (e.g., 2, 4, 6...) or odd number (e.g., 1, 3, 5...) and then give you the summation of the number you entered. For example, if … | |
i am looking for a good tut for shell scripting if anyone know's a good please post here thanks :) | |
hi, i have just started with scripting and read several tutorials. But i have some doubts, 1) How do i print the file access permission(FAP),... not changing the FAP... but printing it ?? 2) how to search for duplicate files in current directory ? 3) how do i validate a … | |
Hi All, We now have a Log file which has time stamps of all the scripts ran. It has start time and end time. I now have a requirement to send mail to the Admin after the script finishes running. Can some one help me with a Script which will … |
The End.