1,892 Topics

Member Avatar for
Member Avatar for shouvik.d

Hi, I am using a scheduled task that runs every night to take backup of important files. This task creates a folder in the following format Backup_DD_MM_YY where DD_MM_YY denotes the date when the backup was taken. Now everytime this scheduler runs I need to remove the older directory and …

Member Avatar for eggi
0
345
Member Avatar for baudday

Hi, I've been looking all over, and I can't seem to figure this out. I have to generate a random number within the range of -99 and 99. I know about RANDOM, but I don't know how I could use that to keep the numbers within this range. Any help …

Member Avatar for fpmurphy
0
189
Member Avatar for Pender

hi, i hope someone can help here with my problem. i have a file with this structure: testtt Login-Lat-Group = CNAme Auth-Type = whatever testt Login-Lat-Group = CName Auth-Type = whatever test Login-Lat-Group = CName Auth-Type = whatever i need now a command (e.g. awk or sed) which deletes the …

Member Avatar for eggi
0
163
Member Avatar for chris5126

Hi guys, Will keep this short and sweet. Trying to do integer devision to *decimial places but i dont think the version of ksh installed on solaris 10 supports this as they would need to be declared as floats. Is this correct? If there isnt a way of doing it …

Member Avatar for Fest3er
0
137
Member Avatar for rusman

I need to read in a list from a file, but I want to always ignore/skip the first line of this file. Right now I'm just cat'ing the file and awk'ing the first column as that's all I need. However, this will also give me the first column of the …

Member Avatar for eggi
0
4K
Member Avatar for DimaYasny

Hi, I am looping through some files, gathering information into an array during that loop. The array grows with the loop counter and at every point might be longer or shorter (more or less members in it) so in order to reuse the array I need to drop all values …

Member Avatar for DimaYasny
0
141
Member Avatar for krammer

Does anyone know why this script would give me an error (only sometimes) with it saying "too many arguments"? [CODE]#!/bin/bash HOME='/home/eric' arrFiles=("$HOME/.kde/share/apps/kaffeine/playlists/NEW.kaffeine"\ "$HOME/.kde/share/apps/kcookiejar/cookies"\ "$HOME/.kde4/share/apps/kcookiejar/cookies") arrDirs=("$HOME/.kde4/share/apps/RecentDocuments/*"\ "$HOME/.kde/share/apps/RecentDocuments/*"\ "$HOME/.macromedia/Flash_Player/#SharedObjects/*") case "$1" in trash) rm -r $HOME/.local/share/Trash/* echo Trash emptied ;; history) #Clears Files for x in "${arrFiles[@]}"; do if [ $x = …

Member Avatar for eggi
0
203
Member Avatar for gps1234

I am going to write scripts to test IPV6 (RFC 3542); Anybody suggest me how can I start with this ?

Member Avatar for ithelp
0
88
Member Avatar for learnpro

Hello Everyone, I am a total beginner in UNIX/Shell script. I am in the process of creating a huge script for a spellchecker program. What it does is spellcheck files and throws output in a temporary file. What I need help in is forming a [B]for loop [/B]where it will …

Member Avatar for eggi
0
180
Member Avatar for Trekker182

I'm reading up on jobs and processes in UNIX and was a little confused. A processes is just something that executes and then dies right away, like a grep command issued from the shell, right? It started, did what it was supposed too, outputs the info and then dies so …

Member Avatar for omrsafetyo
0
512
Member Avatar for carson myers

Wasn't sure where else I was supposed to put this but I recently installed VMware and a copy of MS-DOS 6.22 using .img files mounted to a virtual drive in the virtual machine. I have a couple questions... 1. there is no "shutdown" command in this version of DOS, is …

Member Avatar for carson myers
0
268
Member Avatar for cristi2008
Member Avatar for cristi2008
Member Avatar for eggi
0
110
Member Avatar for cristi2008
Member Avatar for eggi
0
103
Member Avatar for Trekker182

I'm a little confused on umasking. The way I was shown to do it manually is to take whatever number the umask is, say 123, turn that into binary for the permissions. 001010011 flip the bits 110101100 and then take away executability 110100100 thus I get rw-r--r-- but when I …

Member Avatar for eggi
0
162
Member Avatar for littlestone

Some of my source files include the following code. [code] #ifndef AAAAAAAAAAAA #define AAAAAAAAAAAA #if !defined(__lint) && !defined(_lint) XXXXXXXXXXXXXXXXXXXXXXXXX; #endif #endif [/code] I want to delete line1, 2, 6. So, Could somebody tell me how to do it? thank you in advance!

Member Avatar for eggi
0
143
Member Avatar for krm142

Hi frnds.. Need help in writing a small script... I have the following text file... 1)PPI2MSNK I5 P50 2) PIAIS Major 3)PPI2MSNK I5 P51 4) PILOS Major 5)PPI2MSNK I5 P57 6) PIAIS Major 7)PPI2MSNK I7 P57 8) PIAIS Major I want the script to join the line 1-2 , 3-4 …

Member Avatar for krm142
0
275
Member Avatar for AcidG3rm5

I have the following information in the text file: 1:boot 2:book 3:booze 4:machine 5:boots 6:bungie 7:bark 8:aardvark 9:broken$tuff 10:robots 11:rebine when i did a grep -n "b*" a_file.txt, it returned 1:boot 2:book 3:booze 4:machine 5:boots 6:bungie 7:bark 8:aardvark 9:broken$tuff 10:robots 11:rebine I thought it would match the letter b followed …

Member Avatar for Salem
0
122
Member Avatar for wmuldoon

I'm currently trying to write a shell script at work that would loop and allow me to enter the date, and the ad number of a PDF file, that would then copy that ad into a designated file and I can't get it to run correctly heres the code: [code] …

Member Avatar for wmuldoon
0
100
Member Avatar for Mujzeptu

As the title suggests, I am wanting to create a simple script for system administrators. When you run this script in a linux shell, it will ask you what you want to set the local systems hostname to (so the admin can type it) and then prompt the administrator for …

Member Avatar for JeoSaurus
0
152
Member Avatar for curto21

I need help trying to execute a script remotely using ssh. I'm writing a script that will run on a local machine. From that script I need to execute a script on a remote machine. The problem is that when I run the remote script using ssh, it's output is …

Member Avatar for DimaYasny
0
104
Member Avatar for EdTheUniqueGeek

I'm still learning Linux, and have been for the past 7 years, but am still rusty on scripting. Can someone tell me if it is possible to create a script that will change the DNS IP address of your interface from dynamic (from DHCP) to a specific static IP address? …

Member Avatar for eggi
0
195
Member Avatar for c7borg

Hi guys, I'm looking to start scripting and have a problem I thought I would use to learn some basics, basically I have a list of my family's addresses that are in one big vertical list varying in size. I want to sort into a tabular format below is a …

Member Avatar for bugmenot
0
118
Member Avatar for hjast

[code]for (( i = 1 ; i <= 10; i++ )) do #J = 100 echo `expr 1000 * $i` #java SortTester $num >> data.txt done [/code] This is not working why?

Member Avatar for eggi
0
81
Member Avatar for hardeepsp

Develop a program on UNIX only that accepts run-time arguments and outputs the number of command-line arguments given when the program is executed echoes any command-line arguments containing the letter z echoes any command-line arguments that start with test echoes any command-line arguments that end with .doc Please help me …

Member Avatar for eggi
0
87
Member Avatar for rockX

Hey i have another query . I am trying to add all odd and even columns of the percentages calculated and adding them as columns to the left of the percentages. so in the above percenages calculated totoal odd would be `($1+$3....= 45.83+51.61...)` same thing for even as well o …

Member Avatar for eggi
0
118
Member Avatar for Trekker182

I just used mkdir myDir{1,2,3} to create 3 directories called myDir1, myDir2 and myDir3 in the same root directory. Now I'm trying to create 5 subdirectories in each by using mkdir ~/myDir*/subDir{1,2,3,4,5} but it's giving me a file already exists message. When I do an ls on the root directory …

Member Avatar for eggi
0
246
Member Avatar for axn

[ICODE]trying to diff new files in a dir cd ${PWD} for line in $(ls *.new) do # lists all new files and then 2nd variable strips the .new extension of the files echo ${line} ${line} | sed 's/\(.*\)..../\1/' diff ${line} ${line} | sed 's/\(.*\)..../\1/' # this doesnt seem to work …

Member Avatar for JeoSaurus
0
145
Member Avatar for vaibav_vv

Hi I am a newbie in shell scripting ... I can honestly say, I am just learning to write shell scripts .. But, I am in need for a script which does the following: There is a file which has the contents as follows: date time contents date time contents …

Member Avatar for chris5126
0
121
Member Avatar for Nashy

Hello people! I have an homework to compile the fax2tiff program. It will be no problem, but how to try my program, if it work? Because I haven't fax file at home, bec. i haven't fax device. I was searching for long time to find some examples for fax files …

0
62
Member Avatar for maurices5000

I thought you guys had an article about WinBatch on this page below. [url]http://www.daniweb.com/forums/member28964.html[/url] Is says what does this community think of WinBatch? or something like that. But i don't see any information on this forum about WinBatch.

0
66
Member Avatar for k2k

I had a similar script in solaris and it had no problem. I wrote this one in freeBSD and it gave me strange output. Can anyone please tell me why? thanks a lot [code] #!/bin/sh #This is a shell script that checks file system capacity mounted on /home directory #If …

Member Avatar for eggi
0
104
Member Avatar for grambo

I'm trying to load some data I download from my real estate system. They have split out the features in a separate file. Here are my 2 files: File1.txt (~25,000 records) |123|Main|St|City|State|1701,1708|800,801|MORE|MORE|ETC| |987|Bailey|Dr|City|State|1702,1708,1717|800,801|MORE|MORE|ETC| File2.txt (~1,300 records) |RES|800|City Sewer| |RES|801|City Water| |RES|1701|1 Car| |RES|1702|2 Car| |CND|1702|2 Car| |RES|1708|Door Opener| |RES|1717|Side Load| …

Member Avatar for eggi
0
94
Member Avatar for mashimaro

Hey, I wanted to write a script that would act as a shell, meaning: would display prompt, read from keyboard and run system commands. My guess would be to use fork() and exec() and strtok(), so I wrote this: [CODE] #all includes <bla.h> main(int argc, char *argv){ int proces; char …

0
52
Member Avatar for ckcy2005

Hi All, I am facing a problem. I need to do a script which to generate the temp.txt file first when select from database, until the data finish store into temp file then -> MV temp.txt to finish.txt. Any idea? or any sample script for me to refer? I am …

Member Avatar for JeoSaurus
0
143
Member Avatar for packet

Hello All, I am facing one basic problem please help me out here is my script while [ 1 ] sleep 2 data=16:37 one=15:00 two=17:00 I need to check that is data lies between one and two ( data has to satisfy both one and two ) done how? please …

Member Avatar for JeoSaurus
0
163
Member Avatar for rockX

I have about 5000 columns of data that i need to convert all of it into pecentages. for shorter colums i have been using this code: {print $1/($1+$2)*100,$2/($1+$2),$3/($3+$4)*100 .....} but this is a teadious process... with help i got this sed "s/[0-9]*.[0-9]*/&~/g" | tr "\n" " " | tr "~" …

Member Avatar for eggi
0
179
Member Avatar for flying

Looking to figure out how to do set an at job up from within a shell script w/o using the -f option. The at -f option provides no method (that I can determine) for passing additional command line parameters to the file. I have explored trying to use stdin redirection …

Member Avatar for omrsafetyo
0
245
Member Avatar for prabowoadis

Hai there, I would like to ask about currency format in Bash script let say i have $US2550000, after format it, it become $US2.550.000,00 Thanks for the help

Member Avatar for omrsafetyo
0
970
Member Avatar for macuhail

I am attempting to write a shell script that executes a query on a mysql database. It seems to run fine in the mysql panel, but not in the script. The code is: mysql -u username -ppassword -e 'delete from table where forumid = 25 and replace (title, ' ', …

Member Avatar for macuhail
0
88
Member Avatar for chris5126

Hi guys, i have a ksh script that gets some info on processes and puts it into a temp file: [code] /usr/ucb/ps -auxxx|awk '{print $3," "$4," "$2," "$1," "$11}'|grep -v 0.0|sed 1d > $TMP [/code] It gets the following data [code] 0.8 6.2158230724046144 9918 oracle 0.3 6.2158200964043168 15298 oracle 0.2 …

Member Avatar for JeoSaurus
0
184
Member Avatar for begyu

I have a file containing numbers in the following form: (it has 4 columns and 5 rows and the 3rd row is an empty line) [CODE] (0.761249,0) (0,-0.42632) (0,0.42632) (0.238751,0) (0.636502,0) (0,-0.42632) (0,0.42632) (0.363498,0) [/CODE] and I would like to have like this: (and there would be a number "2" …

Member Avatar for chris5126
0
101
Member Avatar for serkan sendur

i basically want to open a .cpp file modify it and save it. how do i do it using korn shell in unix?

Member Avatar for JeoSaurus
0
98
Member Avatar for chris5126

Hi guys, I need a command on solaris 10 to show how much cpu is bein used in % terms but more specific than sar i need it down to 0.0% if that makes sense. Basically im tryin to find out how much cpu is being used say 25.5% and …

Member Avatar for chris5126
0
95
Member Avatar for Neo7

Hi everybody!! Here is the problem, I'm trying to develop a script that can help me with the raid creation, but, till now, I have been dealing for more than a week and I still didn't achieve any satisfactory results. :icon_cry: Here is the code to execute: # mdadm --manage …

Member Avatar for Neo7
0
190
Member Avatar for chris5126
Member Avatar for ROTC89

ok now im working on another code. i have to add two arrays together to form one array. all that i am getting for the output is 2. here is the code...i know i am missing a few things but i just do not know what exactly. i # some …

Member Avatar for eggi
0
124
Member Avatar for ROTC89

hi im new to this shell scripting. I was assigned to develop some code that increased from 0 to 9 in sort of a pyramid. This is what the output should look like. 0 01 012 0123 01234 012345 0123456 01234567 012345678 0123456789 here is my code please help because …

Member Avatar for eggi
0
274
Member Avatar for chris5126

Can someone tell me why this routine doesnt print out read/write statistics for the first device but does for the other two. I cant seem to work it out. Oh its a ksh script runnin on a solaris 10 box. [code] find_disks() { NETWORKDRIVE=/tmp HOST=`/usr/bin/hostname` integer k=1 integer i=`iostat -en …

Member Avatar for chris5126
0
118
Member Avatar for JustinJose12002

Hi All, How to read the following command line values for a in my shell script? ./test.sh -a file1 file2 file3 i know we can use getopt() but i am geting only first value(file1).. Any help appreciated -jujose

Member Avatar for chris5126
0
124

The End.