1,891 Topics
| |
Team, I have a shell script which will b run in cron job. On an adhoc basis. The script needs to be run such that the moment it goes to the particular directory. It should adapt to its ownership. But the script which i had shared below is run by … | |
The script below is what I have. It does not block other computers that are not in this firewall Check_Mac list. Where is the mistake? Thanks!!! tuxhats #!/bin/sh IPT="/sbin/iptables" # Change to your server ip like this LAN="10.229.2.0/24" , leave the "0/24" alone LAN="10.229.1.0/24" $IPT -P INPUT DROP $IPT -P … | |
I'm attempting to recreate the Unix shell program "todo.txt" using C++ on Windows. An example use of my program in the Command Prompt would be: [CODE]>todo /A "I like cheese."[/CODE] which would append the item "I like cheese." to the file "todo.txt". In my program, there is a line which … | |
Hi all I hav written a very small shell script in bin bash & its not working. The script is :: [CODE]#!/bin/bash i=1.0 while [ $i -le 3.0 ] do i=`expr "$i + 0.5" | bc`; echo "i=$i" done [/CODE] The error is : [CODE]line 6: [: 1.0: integer expression … | |
How Do I send emails to group of persons daily at 12:00 AM ?? I have a PHP page where I will write code to sending mail. I searched and find CRONTAB (shell scripting), a solution for this. If I want to use CRONTAB shell scripting then How I can … | |
Hi, I am having a lot of issues using grep. I am trying to counts the number of lines which start with the letter “L”or “W” and end with the number 3. I can find and count the lines that start with L or W just fine, but I cannot … | |
In a shell script, I want to 'spool' (record) the shell prompt & command typed alongwith its output into a file. eg: In the script, if I give a 'ls' command, the file should contain: [CODE] <<root@server ~>>$ ls a b c.txt <<root@server ~>>$ [/CODE] i.e. the command as if … | |
I am trying to move the huge no of file into different folder.. the files in the style of "HNI [0-9]{3}.*.jpg" i.e [ICODE]HnI 001.Sunday Party.jpg HnI 002.Car.jpg . . . and so on[/ICODE] I want to place the certian no of files in the single folder like.. .[ICODE]mv file1 file2.... … | |
Hi,I have myfile.csh first second third ..... How can I find how many variables I apply to the file Thanks | |
Hi All, I am trying to write a shell script that filter java exceptions along with stack trace from a log file and also it has to count how many times each exception has occurred in the log file. Please help me in this. The resulting file should be like … | |
Hi, I am running Ubuntu 10.04 LTS, and wanted to install RVM today, I used: bash < <( curl [url]http://rvm.beginrescueend.com/releases/rvm-install-head[/url] ) (NOTE: I already have git-core and curl, etc.) After running that command I get the output in terminal from Wayne, and I added: if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; … | |
My script is as follows : [COLOR="Red"]echo " enter the directory path of file " read DIR_PATH path=$DIR_PATH cd $path echo "">/tmp/df_mac echo " enter the name of file" read EXCEL_FILE echo $EXCEL_FILE src_file=$EXCEL_FILE count=`expr 1` one=`expr 1` while read line do IDX=`expr index $line \/` echo $IDX echo $line … | |
Hello, I have stared at this script for the last two days and am unable to find the cause of my error message. Any help would be greatly appreciated. The script is [CODE] #!/bin/sh for i in '/xxx/*' do if [ -f /xxx/$i ] then HOST='xxx.xxx.com' USER='xxxx' PASSWD='xxxx' FILE='$i' ftp … | |
Greetings everyone, I was looking for some help in creating a seemingly simply backup script. I have two servers, laid out in the same format: Server A: the directories contain all the iterations of a certain type of file Server B: the directories contain only the most recent file. The … | |
I have a text file that contains separate lines where this text will always appear, short_message=<some text>. The <some text> part could potentially be different on every line. What I'd like to do is extract the <some text> text and only that text from the file. I don't want the … | |
What's Up? OK, So I'm making a small batch script, That retrieves the IP of a website, And put it into a variable so we can use it later on. The problem is how do I get the IP of the website into a varible? The way I was going … | |
Does anyone know if its possible to type in a number and get the resulting ASCII characters in a batch file? I think in Unix based machines you type the command then \042 or whatever number you want, but I don't know if you can do it in batch files... | |
So I'm new to python, although not terribly new to programming. I am going through some tutorials, but am having some trouble. I am trying to execute a program from the python shell (using Python 3.1). Right now, I have the >>> prompt. I can't seem to get any program … | |
Am trying to get this code to work where the user enters n rock,paper,or scissors and the computer randomly picks as well, it then states what each choose, once u click ok it tells who won the match but my code once it shows the 1st winner result have to … | |
I've been trying to automate the creation of a user account with admin rights using cmd bat . [CODE] net localgroup administrators [I]account name[/I]/add [/CODE] got the following error: [CODE]There is no such global user or group:[I]account name[/I][/CODE] what's the problem? | |
Hi all, I am going slightly insane about this because I have been spending a lot of time on this simple thing and I am not sure what is wrong. I just want to rename a couple files that are time and date stamped to something that I can easily … | |
Hi all, I got stuck into a problem. I have a variable in which the data is stored as below: variable_test=0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s .....an so on. There are lots of values in format like "3m1.057s" are stored in variable_test separated with an space between two such values. … | |
Hi, I need a script that will generate a set of random strings in sequence, with the ability to predetermine the length, quantity, and alphabet of individual string, and to use the outputs of earlier strings in the sequence to define the parameters of later strings. For examples, I might … | |
| I have an electronic subscription to a newspaper and I generally download and print the puzzles for doing them later. Due to health issues, I'm behind about 6 months, but I'd like to catch up. I'd like a script to automate the download and save it to my PC. I'm … |
Hi all, I am new to Linux/shell scripting having moderate knowledge. In my script, I need the execution time of command (say 'ls') in mili seconds level. For this, I would like to use 'time' command. The problem is that, how to save the output of time command in a … | |
i just want to kno if the default gw part is correct should it be with or without the brackets ? [CODE] #!/bin/bash ifconfig eth0 146.192.188.106 netmask 255.255.255.0 broadcast 146.192.188.255 up sudo route add default [gw] 146.192.188.254 dev eth0 ifconfig eth1 10.10.160.188 netmask 255.255.255.0 broadcast 10.10.160.255 up sudo route add … | |
Hi all, I have a proplem when embed shell into C code by Sytem() command. There is my code: [COLOR="Green"]char acCommand[512]; acCommand[0] = '\0'; sprintf(acCommand,"sed 's/\<UDN\>\<\/UDN>/\<UDN\>%s\<\/UDN\>\/g' %s > %s", initParam.UDN, "/tmp/web/dmr.xml", "/tmp/web/dmr.xml.tmp"); printf("[%s]", acCommand); system(acCommand);[/COLOR] and below is output after compiling: sed 's/<UDN></UDN>/<UDN>uuid:b346ee95-93b3-4922-a132-cf72762b9318</UDN>/g' /tmp/web/dmr.xml > /tmp/web/dmr.xml.tmp] [COLOR="Red"]sed: bad option in … | |
Hi all, We have many number of Procedures/Packages/Functions/Package bodys.In these objects some coulmns contains Hardcoded values.we need to find out the hardcoded values for that particular column.Right now we are doing manually by analyzing the code and find out the hardcoded values. Is it possible to write any shell script … | |
| Hey guys, it's been quite a while since i've been on here :P I'm fiddling around with the Go language. However, I'd much rather have a build script that'll compile the program for me than typing in the lines of code necessary every time: [CODE] 6g hello.go 6l hello.6 ./6.out … |
The End.