1,891 Topics

Member Avatar for
Member Avatar for whizkidash

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 …

Member Avatar for thekashyap
0
175
Member Avatar for tuxhats

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 …

0
133
Member Avatar for MasterMic

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 …

Member Avatar for MasterMic
0
234
Member Avatar for alice06

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 …

Member Avatar for alice06
0
89
Member Avatar for abhi10kumar

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 …

Member Avatar for smantscheff
0
127
Member Avatar for Pandamonium

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 …

Member Avatar for shibblez
0
169
Member Avatar for sanju1311
Member Avatar for tuse

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 …

Member Avatar for shibblez
0
2K
Member Avatar for rhoit

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.... …

Member Avatar for rhoit
0
448
Member Avatar for kukuruku

Hi,I have myfile.csh first second third ..... How can I find how many variables I apply to the file Thanks

Member Avatar for JeoSaurus
0
52
Member Avatar for kavithanb

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 …

Member Avatar for JeoSaurus
0
101
Member Avatar for ChaosKnight11

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" ]] ; …

0
160
Member Avatar for suman.great

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 …

Member Avatar for suman.great
0
168
Member Avatar for medaugh

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 …

Member Avatar for JeoSaurus
0
622
Member Avatar for madtorahtut

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 …

Member Avatar for JeoSaurus
0
145
Member Avatar for brick79

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 …

Member Avatar for JeoSaurus
0
97
Member Avatar for Syphilis

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 …

Member Avatar for JeoSaurus
0
140
Member Avatar for gsingh2011

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...

Member Avatar for SimonEyes
0
4K
Member Avatar for LadyRelm2

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 …

Member Avatar for snippsat
0
1K
Member Avatar for lance7tour

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 …

Member Avatar for Ezzaral
0
329
Member Avatar for D33wakar

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?

Member Avatar for VulcanDesign
0
138
Member Avatar for madtowneast

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 …

Member Avatar for masijade
0
148
Member Avatar for linux.buzz

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. …

Member Avatar for cfajohnson
0
144
Member Avatar for vajrajames

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 …

Member Avatar for cfajohnson
0
120
Member Avatar for irenejd

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 …

Member Avatar for irenejd
0
148
Member Avatar for linux.buzz

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 …

Member Avatar for griswolf
0
128
Member Avatar for moroccanplaya

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 …

Member Avatar for failer
0
102
Member Avatar for Dwiliam

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 …

Member Avatar for Dwiliam
0
218
Member Avatar for vasuv

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 …

Member Avatar for griswolf
0
341
Member Avatar for BobTheLob

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 …

Member Avatar for griswolf
0
94

The End.