1,892 Topics

Member Avatar for
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
334
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
141
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
150
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
146
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
123
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
151
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
131
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
106
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
220
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
346
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
98
Member Avatar for ammayi67

thanks for allowing me join your forum i have an output of linux command "who" which provides following details..... CURRENT USER/ACCT INFO 17:31:36 up 4:49, 4 users, load average: 0.03, 0.04, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root :0 - 12:59 ?xdm? 4:54 0.02s /bin/sh /usr/bi root …

Member Avatar for JeoSaurus
0
2K
Member Avatar for gian10890

SOBA11009_1_1.xml SOBA11009_1_2.xml SOBA11009_1_3.xml SOBA11009_1_4.xml SOBA11009_1_5.xml SOBA11009_2_1.xml SOBA11009_2_1.xml SOBA11009_2_2.xml SOBA11009_2_3.xml SOBA11009_3_1.xml SOBA11009_3_2.xml SOBA11009_3_3.xml 978-0-387-98595-4 Is it possible that I want to create a batch file that overwrites the SOBA1109 with 978-0-387-98595-4? output: 978-0-387-98595-4_1_1.xml 978-0-387-98595-4_1_2.xml 978-0-387-98595-4_1_3.xml 978-0-387-98595-4_1_4.xml 978-0-387-98595-4_1_5.xml 978-0-387-98595-4_2_1.xml 978-0-387-98595-4_2_1.xml 978-0-387-98595-4_2_2.xml 978-0-387-98595-4_2_3.xml 978-0-387-98595-4_3_1.xml 978-0-387-98595-4_3_2.xml 978-0-387-98595-4_3_3.xml

Member Avatar for JeoSaurus
0
178
Member Avatar for manish250

hello all i m writing a script in which i am trying to set classpath using this export CLASSPATH=$CLASSPATH:/usr/java and then i run the script But nothing is added in the bash_profile

Member Avatar for griswolf
0
809
Member Avatar for abrmhk

Hi I am reading x lines from a text file into an array per line: [CODE=ksh] integer SCRIPT_LINES=0 while read VAR1 VAR2 VAR3 VAR4 VAR5 do .... SCRIPT_LINES=$SCRIPT_LINES+1 set -A SCRIPT_${SCRIPT_LINES} ${VAR1} ${VAR2} ${VAR3} ${VAR4} ${VAR5} ... done [/CODE=ksh] This creates a number (SCRIPT_LINES) of arrays: SCRIPT_1, SCRIPT_2, SCRIPT_3, .... …

Member Avatar for scoude
0
177
Member Avatar for Elandir

Hi there, I have a little problem with commands. I know this is about shell scripting but i couldn't find a thread for commandlines. So i have this assignment to "display all the lines for tcp- services and udp- services and count the lines" and i honestly don't have an …

Member Avatar for Elandir
0
210
Member Avatar for naiksuresh

I am supposed to find a file recursively in a given directory. Rules are not to use find and recursive options like ls -R and grep -r. I can any other other option expect recursive. I had written the script using recursion. [CODE]#!/bin/csh foreach i (`ls -R $1 | grep …

Member Avatar for naiksuresh
0
107
Member Avatar for Newbi1984

Hi Daniweb members, I have two files that are not of equal dimensions and I need to match them on a unique key much like an SQL natural join. The files are space delimited and contain no headings. File 1 rs121 10001 A G rs125 10002 C T rs126 10003 …

Member Avatar for nezachem
0
928
Member Avatar for mojo1979

Hi, I'm pretty new to scripting so need some help... Basically I have a 1TB drive that hosts hundreds of .mdf files. What I want to do is search this drive for these .mdf files, zip them, and then delete the original .mdf file permanently. Any advice/help would be greatly …

Member Avatar for cfajohnson
0
103
Member Avatar for poobert

I'm trying to write a script that downloads and image off the net with wget. The script should save the file named as the date it was downloaded preferably with a suffix. Any ideas on how to accomplish this using wget?

Member Avatar for poobert
0
203
Member Avatar for mirasravi

I want to download a series of files say 150 files whose download links are similar but they vary only by a number. That is, the general download link is: [url]http://www.example.com/content/download_content.php?content_id=#[/url] where # is a number b/w 1 and 150. Which of the following works best? Share your suggestions too.. …

Member Avatar for mirasravi
0
241
Member Avatar for moroccanplaya

im new to shell scripting i want a simle script to configure the ip adress and add a default gw this is what i got so far [CODE] #!/bin/bash ifconfig eth0 "ipadress" route add default gw "gw adress" [/CODE] it does not recognise route ? can anyone help?

Member Avatar for moroccanplaya
0
132
Member Avatar for narlapavan

how to copy data from one system to another in solaris.. i have tried rcp,scp commands but some times its not working.... tell me if there are any other commands other than rcp and scp .

Member Avatar for ~s.o.s~
0
107
Member Avatar for manish250

hello all i hav a script when i print it's execution in some line there is #+ in the starting and somewhere there is #++.can anyone plz tell me about these

Member Avatar for cfajohnson
0
133
Member Avatar for k2k

sounds it should be simple but I wasn't able to google this out. basically i want to do something like [code] variable = `data` //from unix but I now need it for windows bat script [/code] [code] //windows set today = "date /t" //output is what i need, but wrong …

0
59
Member Avatar for Keidi

I am trying to call a php script through a shell script.The script is to be called as the run on receive directive of gammu-smsd.My php script executes as expected when I call it using[CODE]/opt/lampp/bin/php myvarsreader.php[/CODE].However on trying to run my script(From terminal): [CODE]#!/bin/sh PROGRAM=/opt/lampp/bin/php myvarsreader.php eval "$PROGRAM \"\${SMS_${i}_NUMBER}\" \"\${SMS_${i}_TEXT}\"" …

Member Avatar for ckoy
0
396
Member Avatar for k2k

set v1=%e:\file1\file0% set v2=%c:\file1\file0% set v3=%d:\file3\file4% cd %v1% and do something cd %v2% and do something cd %v3% and do something I just want to set a variable = path and cd to it later, since I have multiple pathes, i would like to cd to diff variables instead of …

Member Avatar for k2k
0
172
Member Avatar for b1izzard

Hi all, I want to compile the cobol program with a click of a button in toolbar provided if its compiler location and command to compile is specified. e.g [CODE] c:\cob>cobol hello.cob 'command line equivalent [/CODE] VB equivalent: [CODE] Dim command As String command = "cd " & app_path 'app_path="c:\cob" …

Member Avatar for b1izzard
0
183
Member Avatar for henryford

I need help counting the number of attempts to guess the right number. I can't seem to get the total number. I get an output like this 0+1+1+1+1+1 and so on. [CODE] secretNumber=$(( ((`date +%S`) % 59) +1 )) guess=-1 count=0 while [ "$guess" != "$secretNumber" ]; do count=$count+1 echo …

Member Avatar for shibblez
0
142
Member Avatar for sparkthesunoff

Could you please help me with this task? "Write a shell script which solve the task without the whereis command. The parameter ($1) is a file name. The script tells you which directories (maybe more than one) does the file exist in. (in the all-time PATH variable)" So far, i …

Member Avatar for rch1231
0
171
Member Avatar for CarterLangley

Hi all, I have a small problem. I need to be able to help the members of the organisation I belong to setup their email accounts. Now, I am at the best 2 1/2 hours drive away from them, so I can't drive there everytime somebody wants to setup an …

0
62
Member Avatar for f.damati

Hello everybody, I want to automate the installation of a software, this software could be downloaded in any directory. So to successfully install this software it needs the path of the setup file. So I am trying to write a batch script in order to find the full path of …

0
63
Member Avatar for manish250

hello all i m new to shell scripting.i have seen th code substitution like a=`ls -l` and a=23 R=$(a/23/bb) first time we use ` ` and second time we use $ . can anyone tell me Why so?

Member Avatar for rch1231
0
145
Member Avatar for stharmon

Hello, I have written a script to automate a software install. I am running the script as root, but need to su to another user to configure and complile the program properly. Whenever I do the shell script su's to the user properly but the scripts stops executing until I …

Member Avatar for rehm
0
4K
Member Avatar for rmsagar

I am trying to search files starting with the name properties.* inside a directory and assign to an array. When I try to print the array outside the loop, it shows empty. Inside the do loop, it prints fine. How will make this array global or take the values outside …

Member Avatar for cfajohnson
0
111
Member Avatar for rickylakhay

hi guys. i seem to be having a problem using ms dos. now manually i know how to connect to a network and upload files onto a server. im struggling to create a shell script that will automatically detect when an internet connection is present and then connect to it. …

Member Avatar for VulcanDesign
0
357
Member Avatar for marco83

I hope somebody could help me with a couple of things... First, I would like to search the /etc/passwd file for the full name of a user given his/her username. i've tried the following command: cat etc/passwd | grep -w '`whoami`' | cut -f 5 -d ':' of course that …

Member Avatar for JamesWhite..
0
225
Member Avatar for samarudge

Hey, So I have a *NIX box (CentOS 5.5) which runs a number of background processes, I leave it on 24/7 with just a terminal up on the screen (I don't have Gnome, KDE or any similar graphical frontend, just a prompt). Is there any way to get my background …

Member Avatar for shibblez
0
166
Member Avatar for apanimesh061

[CODE]function forcd { len=`wc -c /home/mint/AP/file2.txt | cut -c1-2` cutcmd=`cut -c4-$len /home/mint/AP/file.txt` cd $cutcmd } newvar=`pwd` clear echo "root"$newvar">" read cmd until [ "$cmd" == "exit" ]; do echo $cmd > /home/mint/AP/file.txt cutcmd2=`cut -c1-3 /home/mint/AP/file.txt` if [ "$cmd" == "dir" ]; then ls -l elif [ "$cmd" == "dir /p" …

0
47
Member Avatar for vegaseat

Suddenly I am interested in the tcl scripting language. Does anybody know a good website to learn the rudimentaries.

Member Avatar for gwmorris
0
3K
Member Avatar for programmer321

[code] Can any one guie me how to find yesterday's date (taking care of the leap years as well)in the format yymmdd using a shell script. Regards. [/code]

Member Avatar for cfajohnson
0
3K
Member Avatar for shyam miyatra

I want total months between two date (I/p) i want exactly four batch on the basis of date , for ex. i/p Start date : 01-JUN-2005 (or format can be 20050601 - YYYYMMDD) i/p End Date : 01-OCT-2006 or format can be 20061001 - YYYYMMDD) so in this scenario each …

Member Avatar for kevinkatia
0
857
Member Avatar for bojomojo

Hello, I have in a file some text, the area I am concerned in is: #COMMAND TRUE #COMMAND2 TRUE (anytext)1 #ENDCOMMAND I want it to be changed to #COMMAND2 TRUE 1 .. Please note that I dont want all "#ENDCOMMAND"s to be deleted, as there are some not associated with …

0
59
Member Avatar for rgpii

Hello, I had an idea for a script and I was going to get everyone's opinion if shell scripting was actually the appropriate medium to try and get this task accomplished. I want to check and see if a message board thread has been updated or not and then if …

Member Avatar for griswolf
0
67
Member Avatar for sparkle85

Hello, I need some help with the following script: [CODE] if ! [ -f ${APATH}/myfile.txt ];then echo $(date +%Y%m%d"_"%H%M%S)": Nu am gasit fisierul ${APATH}/myfile.txt" ps -fxu pin | grep "/usr/local/coreutils/bin/tail -f ${LOG_PATH}/x.log$" | awk '{system("kill "$2)}' cat ${LOG_PATH}/x.log | sed -n -e '/LONG/{x;1!p;g;;}' -e h > ${APATH}/myfile.txt /usr/local/coreutils/bin/tail -f ${LOG_PATH}/x.log …

Member Avatar for JeoSaurus
0
165
Member Avatar for alice06

Hi all 30 students have sent me their answers to me in folders, "[B]name1[/B]", "[B]name2[/B]", ..., "[B]name30[/B]". Each folder contains 2 outputs, "[B]output_a.txt[/B]" and "[B]output_b.txt[/B]" Now I have the correct answer "[B]correct_a.txt[/B]" and "[B]correct_b.txt[/B]" with me. I know that using the command diff, I can compare 2 files :: [CODE]$ …

Member Avatar for masijade
0
72
Member Avatar for novice20
Member Avatar for vaibhav1983
0
72
Member Avatar for polygon

I have a script called setuptex that is run on a terminal as [CODE]. ~/context/tex/setuptex[/CODE] I wanted to execute it from a bash script file instead of typing it each time on an interactive terminal. Since the dot operator and the source builtin command are similar, and I wanted a …

Member Avatar for vaibhav1983
0
513
Member Avatar for R2605

Hello, I'm a new python user and I'm trying to create a python program that will run on a targate and communicate with the terminal. The main idea is to run several commend and short programs and analyze the results. for example running those 2 commands: cd /home/user/folder ls | …

Member Avatar for R2605
0
118
Member Avatar for oceantech

Hi all! I have a directory with multiple text files of data. I have been trying to develop a loop to read through all the files, eliminate the first 88 lines (text header) and create a new file with only the data values. I have been all to write the …

Member Avatar for griswolf
0
120

The End.