1,978 Topics

Member Avatar for
Member Avatar for lehe

Hi, These days I have to install a higher version of bash under my $HOME on my office server. I hope to make the new bash automatically run both when I ssh to my server and when I boot into my office computer which loads my $HOME on the server. …

Member Avatar for eggi
0
166
Member Avatar for rhesus303

[code] if ! [ -t 0 ] ; then read var fi [/code] I know what the result will be but don't understand the conditional test. I've never seen it before nor can I find the -t option in any shell scripting tutorial

Member Avatar for Fest3er
0
77
Member Avatar for rEhSi_123

Hello, I am trying to write a shell script which will have the following: 1. arguments like: -h, -- help, -v, --version, -V, --Verbose, -o filename, --output=filename -s searchphrase, --search=searchphrase, -f format, --format=format 2. a default usage where a user runs a search phrase where the output should go to …

Member Avatar for Fest3er
0
174
Member Avatar for kamel.kimo

Hi every body, i have this file example : TD1 TD2 TD3 . . .TDn <DIE_1> xxxxxx <\DIE_1> <TD1> information 1 inormation n <\TD1> <TDq> information <\TD_q> . . . <DIE_m> xxxxxx <\DIE_m> <TD3> information 1 inormation n <\TD3> <TDP> information <\TD_p> for example i can find TD3 in DIE_n …

0
52
Member Avatar for jimjim56

Hey all, I am trying to write a shell script that evaluates the size of each user's home directory and if it is greater than 50 MB I want an email to be sent to their user account telling them that they need to reduce the size of their home …

Member Avatar for radoulov
0
92
Member Avatar for egmik3

Does anyone know of a simple command that could get the date and make a folder (mkdir) as its name? say todays date 20090304 as the folder name. I guess the first thing would be grep the date? Then run a mkdir command? Any help is appreciated! Thanks

Member Avatar for eggi
0
145
Member Avatar for JimD C++ Newb

Good afternoon all! I am writing an address book for a class that I have, and am stuck on this last part. Any help would be greatly appreciated! When the user selects the "Edit existing record" option, I can't figure out how to make the file overwrite the previous record. …

Member Avatar for eggi
0
390
Member Avatar for k2k

hi, i am trying to write a script to add 100 users and with certain things created. however, all the book and tutorials online recommend and only show the way to use passwd user after creating a user by useradd username. i know there is a -p option for the …

Member Avatar for eggi
0
144
Member Avatar for chadactive

I plan to start learning shell scripting but I want to start with the one I can use. Is there anyway to find out which type and version of shell program XP uses? Is it DOS, PowerShell?

Member Avatar for chadactive
0
194
Member Avatar for chris5126

Hi, I am writing a script to get information on disks for Solaris 10, does anyone know of a way to print out the size of each disk on the system in MB i know how to get it in GB and could do some number manipulation however it would …

Member Avatar for chris5126
0
169
Member Avatar for lehe

Hi, I am beginning to use bashdb to debug my shell script. Here are my questions: 1. With "bash --debugger ./myscript.sh" it will run to finish without stop, while with "bashdb ./myscript.sh" would stop at the beginning. How could I stop in the first usage? 2. I am using Bashdb …

0
96
Member Avatar for lehe

Hi, I am trying to debug my shell script by bashdb. My script take as argument "--gdb", so I wrote [quote]bashdb myscript.sh --gdb[/quote] However, this way it will produce error that bashdb: [quote]unrecognized option '--gdb'[/quote] If I quote --gdb as [quote] bashdb myscript.sh '--gdb'[/quote] then I will end up with …

Member Avatar for lehe
0
94
Member Avatar for ryy705

Hello, I call the imagettfbbox function like so `imagettfbbox($font_size, 0, 'monofont.ttf', $code)` but its generating the following error: 'imagettfbbox() [function.imagettfbbox]: Could not find/open font' monofont.ttf is in the same folder. And the code executes fine on the server. It just won't work on my computer. This leads me to believe …

Member Avatar for mcscreech
0
1K
Member Avatar for oguru

Hi Guys! I would like to create a shell script that checks how many files there are in a directory. If there are more than 20 then delete the ones that are older than 48 hours old. so I have portions for a script, but I can't seem to make …

Member Avatar for oguru
0
64
Member Avatar for Pender

hi all, i have a problem with a sqlplus (v8) statement that queries several tables and writes the output into a csv file. that works so far, but one of the tables is a encrypted user password. the problem is that the encrypted characters can also include control characters like …

Member Avatar for Pender
0
88
Member Avatar for progurammaar

Hi i'm planning to create a music player for linux. I actually dont knw if shell script allows you to create one. Please let me know what programming languages do i need to know to develop one.

Member Avatar for progurammaar
0
102
Member Avatar for chris5126

HI guys, I have file with 6 values in: [code] 1060276 2211546 7544.941158316 1060276 2211606 7545.960677177 [/code] I put those numbers into variables: [code] obyte1=`cat $TMP | sed -n 1p` rbyte1=`cat $TMP | sed -n 2p` snapt1=`cat $TMP | sed -n 3p` obyte2=`cat $TMP | sed -n 4p` rbyte2=`cat $TMP …

Member Avatar for chris5126
0
118
Member Avatar for gornhorse

Hi, I have two shell scripts that do the same thing, but are written differently. The first one works: [code] size=0 pattern=foo for file in * do [ ! -f $file ] && continue if grep $pattern $file > /dev/null then tsize=`cat $file |wc -c` size=`expr $size + $tsize` echo …

Member Avatar for eggi
0
153
Member Avatar for k2k

hi, basically i need to find out how many lines are in a file. would someone please refer me a quick command? i don't think wc would work since i need the line number. thanks

Member Avatar for ddanbe
0
141
Member Avatar for eapln

i am trying to move to the dest_dir from Current Working Directory using the following script. my intension is instead of using cd dest_dir, i have to use the script to do the job. when ever i tried with the follwing script, iam again in my Current working directoy... #!/usr/bin/bash …

Member Avatar for eapln
0
113
Member Avatar for premdeeprem

'*'********************************************************************************* ' ' ' Name : SP Management Utlility ' Author : Prem Dhanendran ' '********************************************************************************* [code] 'Create an instance of the File System object dim objfile, navfile set objfile = Createobject("Scripting.FileSystemObject") if isobject(objfile) then set navfile = objfile.opentextfile("L:\OTAI\Package\sp.txt") end if 'Read the Config file sp.txt on L: Drive line …

Member Avatar for premdeeprem
0
102
Member Avatar for madurai07

[code] #!/bin/bash # Days and Procs declaration DAYS="3" PROCS="dyyno" # 3 days Old date AGO=$(date --date="$DAYS days ago" +"%b %d") # Getting pids PIDS=$(ps eaxo bsdstart,cmd,pid | egrep "^$AGO"' | egrep "$PROCS" | awk '{ print $4}') # killing the processes echo "Killing $PROCS process created $AGO days ago" kill …

Member Avatar for eggi
0
159
Member Avatar for glamiss

i have a couple of servers that are changing perms on /dev/null so that "other" can't access it, at random (well, i'm sure SOMETHING'S causing it, but the timing is random), so i wrote a script to go in the inittab so it'll respawn if it dies (bash shell) the …

Member Avatar for eggi
0
143
Member Avatar for cinnamonhotel

This lesson presents methods that will help you automate Windows XP Professional installations. When you must install Windows XP Professional on computers with varying configurations, scripting provides automation with increased flexibility. You will learn how the Windows Setup Manager makes it easy to create the UNATTEND.TXT files that are necessary …

Member Avatar for Godsp3ed
0
452
Member Avatar for number87

#5report function report { clear echo "Name, Position, Department, Salary" echo "========================================" awk 'BEGIN{FS=","; RS="\n"} {printf "%s, %s, %s, %s\n", $1, $2, $3, $4}' $dataFile awk '{total += $4}END{print total}' $dataFile } i am trying to print the total sum of the salary or $4 field. However i cant figure …

Member Avatar for Salem
0
152
Member Avatar for tomtetlaw
Member Avatar for rgy

hi, can someone help me? i need a hand to get a script for a smal change. iget this kind of structure... 20080926RIM881T.20081127.104856 20080926RIM881T.20081127.104831.done 20080926RIM881T.20081202.084408.done 20080926RIM881T.20081127.104845 20080926RIM881T.20081127.104834 20080926RIM881T.20081216.084909.done 20080926RIM950T.20080929.101124.done 20080926RIM951T.20080929.101124.done 20080926RIM952T.20080929.101125.done i woud like to have a script to find all files with .done then i shoug change all files …

Member Avatar for cfajohnson
0
157
Member Avatar for gauravmishra

I want to retrieve the username and password of the current user from a shell script .... how to do this?

Member Avatar for Salem
0
183
Member Avatar for tondeuse34

Hey guys, i'm having some trouble using wget. What i'm trying do is log into a site, once its logged is to go to a certain link. And once it is there download all the files on the page, but check back later to see if any new ones are …

Member Avatar for eggi
0
108
Member Avatar for lehe

Hi, I am now trying to install a C library zlib to be /usr/local/include/zlib, /usr/local/lib/zlib and /usr/local/share/man. Here is the relevent part in the configure file of the library: [QUOTE] prefix=${prefix-/usr/local} exec_prefix=${exec_prefix-'${prefix}'} libdir=${libdir-'${exec_prefix}/lib'} includedir=${includedir-'${prefix}/include'} mandir=${mandir-'${prefix}/share/man'} [/QUOTE] First, what does "-" mean in "prefix=${prefix-/usr/local}"? Second, how can I achieve what I …

Member Avatar for Comatose
0
83
Member Avatar for amanuensis

I have a folder on my server named [B]'EVENTS'[/B] and it contains an additional 50 folders [B]'EVENT1', 'EVENT2', 'EVENTS3'[/B] etc, etc. Each of these 50 folders contains within them a varying amount of files and folders also. (So that is the set up). I am wondering if it is within …

Member Avatar for eggi
0
138
Member Avatar for Blackeagle
Member Avatar for verruckt24
0
114
Member Avatar for orwell84

I'm getting into bash shell scripting with Ubuntu 8.10, and the tutorial I'm using is telling me to open the file .bash_profile which is allegedly in the home directory. However, I cannot find this file, except in /usr/share/doc/adduser/examples/adduser.local.config.examples/skel and it's called "dot.bash_profile". Plus, the whole thing is just comments. The …

Member Avatar for Aia
0
207
Member Avatar for jehamilt

Hi, everyone. My name is Jerry Hamilton, I've been a SAS programmer/analyst for a little over 28 years and an independent consultant for most of that time. I am busily developing my UNIX shell scripting skills and dabbling in things like Perl. I will be looking to learn from this …

Member Avatar for jbennet
0
26
Member Avatar for Blackeagle

Hello, i'm trying to print specific lines from a file using only [U]one command[/U] for example: a file contains 30 lines , i wish to print the content of lines 13, 14, 15, 16?? what command to use for that?

Member Avatar for Salem
0
100
Member Avatar for ntman4real

Hey Guys, I am a newb when it comes to bash scripting,but I am loving the learning so far. I am at a wall though. I have scoured for hours tryng to find an answer. Basically here is the pseudo code: 1. ask for users grade 3 times in using …

Member Avatar for eggi
0
126
Member Avatar for lehe

Hi, I read something like "\mkdir ${RESULT_DIR}". Just curious about why "\" is added before the command? Thanks for help!

Member Avatar for Fest3er
0
141
Member Avatar for number87

ok what i need to do is to make a script function which allows me to change the records in a file. I read some other posts about using sed but i still could not get it to work. The function runs But nothing changes in my file. This is …

Member Avatar for eggi
0
101
Member Avatar for number87

I am doing a shell script to be able to read some records from a file, then ask the user to input a name. The script should then be able to search the records and only print out the requested record. I have figured out how to print the records …

Member Avatar for Salem
0
116
Member Avatar for AkhileshBabu
0
49
Member Avatar for serkan sendur

1) vi . profile shows alias for commands, you can set the new ones. 2) esc = displays the file and folders in a numbered fashion. 3) esc – or esc k ( esc n does the same thing reversely) shows the previous commands 4) cd esc \ [type something] …

0
57
Member Avatar for AlvinRey70

Can someone please help me with the following questions. 1) Create a script that will produce a text file that has a list of the files in the present working directory. Ensure you use the proper syntax to allow auto-execution from the command prompt. Use internal documentation (comments) to place …

Member Avatar for moqwen
-1
213
Member Avatar for shyamsantra

Hi All, I am trying to compare two folder using "cmp" command. Folder1=/path/to/folder1 Folder2=/path/to/folder2 Folder1 has file name abc.txt efg.txt hij.txt . . . ..................... xyz.txt Folder2 has file name abc.txt efg.txt . . . ..................... xyz.txt I want to compare this two folder with similar name. Means Folder1/abc.txt should …

Member Avatar for eggi
0
83
Member Avatar for jinsonsani

I want to replace a text in a file eg (old_text) with another text eg (new_text) . new_text is a variable in my shell script. few methods that i tried .. but this doesnt work cat $line".sh" sed -e 's/abc/ABC/g' $line".sh" sed 's/ordprg/new_string/g' $line".sh" > $line".sh" Could some one can …

Member Avatar for eggi
0
169
Member Avatar for mustaine85

Hi, how do you append to a variable? I can only get it to work with a seperate file like this: printf $number1 >> sum.txt I tried this : $number1 >> $sum but it says $sum: ambiguous redirect, any ideas? :)

Member Avatar for eggi
0
89
Member Avatar for mustaine85

Can I use my own variables within awk and sed for example: I've written a while loop with a counter $i and I want to use the value of $i within sed and awk to edit certain lines of text within a data file. I want to use : sed …

Member Avatar for mustaine85
0
90
Member Avatar for shouvik.d

Hi There, I have a third party EXE file (on which I have no control of any modification) which invokes a new CMD window in order to execute itself. In other words it a windows console application. Now it executes with some switches for runtime options [ICODE]<exe_name> /opt1 "param" /op2[/ICODE] …

Member Avatar for Fest3er
0
574
Member Avatar for Blackeagle

hello, i'm new with scripts and linux and need a little help. i made a text file called colors using a vi editor and contains as follows: red green blue gold now i want to delete the 2nd line with the word green using a script file. well i know …

Member Avatar for Salem
0
123
Member Avatar for mustaine85

Hi I have a simple question. Is there an easy way read a date of birth from a file and calculate how old that person is based on today's date? And would I need the make sure the birthdates are enterered in a particular format?

Member Avatar for eggi
0
80
Member Avatar for wmuldoon

hello all, I work at a newspaper, and we use QuarkXPress for Desktop publishing...and we have a pretty unfortunate glitch, when Quark crashes, it seems to untick the backup option in the pref's... so I was thinking this would be a good place for a small recursive script, that would …

Member Avatar for wmuldoon
0
254

The End.