1,891 Topics

Member Avatar for
Member Avatar for dwlamb

I am new to bash shell scripting. Converting over to Linux before support for Windows XP fades into the sunset, I am redesigning and rewriting many scripts that worked using enhanced scripting language Take Command. I am trying to evaluate whether a directory exists based on a list of directories …

Member Avatar for FelineHazard
0
148
Member Avatar for winky

Been a long time since I've logged in and had a question, but here goes nothing! I have a file that is not delimited in any way, but I need to replace a particular column character from a space to a alphanumeric value on every other line starting at line …

Member Avatar for winky
0
468
Member Avatar for srinivas88

Hi, I'm running a script to bring down the logical ip address . But if the system doesnt have that logical ip addresss then i get the following error print on terminal - SIOCSIFFLAGS: Cannot assign requested address I just want to know whether there is a way to suppress …

Member Avatar for L7Sqr
0
309
Member Avatar for MrHardRock

Hey guys, I recently had an assignment to write a sort algorithm we have not yet gone over in class. I had no problem getting my code written and to compile, but now that it compiles I keep getting an error that says "Exception in thread "main" java.lang.NoSuchMethodError: main" I …

Member Avatar for Ezzaral
0
228
Member Avatar for abed1986

Hello everyone, I am trying to read in a folder path, delimited by / and ending in COSC, and then output the last field to a file. It is supposed to match all directories that end in a course name, for example, COSC-101 or COSC201. I am using the following …

Member Avatar for abed1986
0
138
Member Avatar for Sundown G

Hi people! I just want to get the sum, max number, average and multiplication of array with n numbers! I already make the sum, but I tried different operators, ways for others and I can't get the another task without errors! Any help! Im really noobie on this Look! #!/bin/bash …

Member Avatar for JeoSaurus
0
120
Member Avatar for enkitosh

I'm doing a program where I need user to enter the name of a text file. I want him to be able to see the path if he enters pwd. Right now this is very OS related and only works on Mac OS(I guess). So I have done string real; …

Member Avatar for enkitosh
0
266
Member Avatar for dwlamb

I am new to bash scripting. Is it possible to get a value returned on a nested variable? At the command line, the following code will generate desired ouput: while read line; do echo -e "${line:21}"; done < Albums-linux.txt It takes a list of directories for albums and returns a …

Member Avatar for JeoSaurus
0
449
Member Avatar for griffman99h

Hope my first post is relevant enough. I'm a newbie coder and this is as much a learning exercise as it is a favor for my girlfriend. She has test results from a device that outputs data to .csv in multiple (100+) files. the important data is the separate file …

Member Avatar for L7Sqr
0
307
Member Avatar for msrikanth

Hi Friends, I need to some help in connecting to webserver using c shell or tcl scripting in linux ie in my office in linux system we have some intranet which is run by tomcat server so i need to connect to that server and read some data existing in …

Member Avatar for JeoSaurus
0
254
Member Avatar for dinesh17

I am writing a simple DHCP server application that gets ip from a server at boot up ! i wrote a shell script to run the java program that obtains ip from server on another machine... The problem is when i have obtained the ip i store it in a …

Member Avatar for JeoSaurus
0
183
Member Avatar for laalesh

Hi All, I want to pass few dynamic arguments to shell script. The number of arguments differ each time I call the script. I want to print the arguments using the for loop as below. But not working out. for (( i=1; i<=$#; i++ )) do echo $"($i)" done /bin/sh …

Member Avatar for laalesh
0
82
Member Avatar for laalesh

Hi All, I want to pass few dynamic arguments to shell script. The number of arguments differ each time I call the script. I want to print the arguments using the for loop as below. But not working out. for (( i=1; i<=$#; i++ )) do echo $"($i)" done /bin/sh …

Member Avatar for L7Sqr
0
65
Member Avatar for 4evrmrepylrning

Hi I have a file with duplicate records they look something like this: [ICODE]<record> <dateadd>012012</dateadd> <nid>R04607295</nid> <reflink></reflink> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>631</num> <author>Anon</author> <title>ON THE WED</title> </record> <record> <dateadd>012012</dateadd> <idref>R04607297</idref> <reflink></reflink> <type>Article</type> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>651</num> <author>Bent, E</author> <title>ENTRANCES AND EXITS</title> </record> <record> <dateadd>012012</dateadd> <nid>R04607295</nid> <reflink></reflink> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>631</num> <author>Anon</author> <title>ON THE WED</title> </record> <record> <dateadd>012012</dateadd> …

Member Avatar for JeoSaurus
0
168
Member Avatar for C0ding

Hello everyone, Is been a while since i've been trying to rename a file using the ren batch command, but for some reasons is not working for me. could some one please give me an idea on how to reanme a file with a batch file? Thanks in advance. This …

Member Avatar for C0ding
0
252
Member Avatar for rusman

I have written a very simple bash script that runs on Solaris10. It runs a command and then sends me the output via mailx. I can run it at the command line (sudoed as root) and it runs perfectly fine. I then set it up to run from root's cron. …

Member Avatar for thines01
0
309
Member Avatar for Felipevd

Hey guys, I was doing some basic bash shell script, as I am new to this, and I can't seem to pass over this error. Here is the code: [CODE] #!/bin/bash echo "Please, type in the day of the week." read Day if (($Day="Monday"));then Monday=date +%d Tuesday=$(($Lunes+1)) Wednesday=$(($Martes+1)) Thursday=$(($Miercoles+1)) Friday=$(($Jueves+1)) …

Member Avatar for JeoSaurus
0
149
Member Avatar for msrikanth

Hi, I Want a shell script, when i run it should print the current row & column number of the terminal in which is invoked , so how can i get the current row & column number in the linux . Thanks Srikanth M.

Member Avatar for msrikanth
0
2K
Member Avatar for java_programmer

I was trying to run a shell script and run it through Cygwin terminal in XP environment. The script I have written is as follows - [CODE]#!/bin/bash read -p "Enter Your name - " fname if test "$fname" == "abcd" then echo "Thank you abcd" fi[/CODE] When I am trying …

Member Avatar for java_programmer
0
690
Member Avatar for nakresimin

is it possible to empty all the tables in the database without dropping them with shell script? if yes could you please show me? thank you

Member Avatar for JeoSaurus
0
83
Member Avatar for RobotFX

Well, I hope this is the right forum, first of all. Here's my issue: I have a lot of images stored in subfolders like this example: [I]/Stallone/photos[/I] or [I]/Aguilera/photos[/I]. I'd like to move all the images from the [I]photos[/I] folders one folder up, if possible. I'm hoping maybe there's a …

Member Avatar for RobotFX
0
111
Member Avatar for PyroPlasm

I have a shell script that is outputting from a database. What is coming from the DB is this: ----------- 50 (1 rows affected) The issue that I have is there is an if statement in my script that looks at the first line and reads the number there. Unfortunately …

Member Avatar for histrungalot
0
165
Member Avatar for sudhanshu12788

Hi, I want to read a file from the command line and remove all the spaces, tabs in it, replacing it with comma(,), and write it to a new file. can you help me out with this scenario.

Member Avatar for deepkw
0
206
Member Avatar for woodson2

I'm trying to enter a block of text into an existing configuration file for OpenLDAP so the setup can be fully scripted. The text below is what I want to enter into slapd.conf and this all works well and good, however as you probably know this will place the text …

Member Avatar for L7Sqr
0
100
Member Avatar for msrikanth

Hi Everyone, I need some help in Tcl Tk Gui Application Development. In that GUI i need 2 drop down lists 1) Subject : , so here a list of subjects will be present 2) Assignment : , So here depending upon the subject again a list of assignments related …

0
76
Member Avatar for Aamit

Hi, [code] check_time() { fileName=$myFileName newTime=$line newtimeaccess="date --date \"$newTime 6 hour\" '+%Y-%m-%d %H:%M:%S'" newtimeaccess=`echo $newtimeaccess | sh` strnewtime=$(date -d "$newtimeaccess" +%s) systime=$(date +%s) if [ $systime -le $strnewtime ] then return "$fileName__0"; else return "$fileName__1"; fi } value=`check_time "$myFileName $line"` ##$myFileName -- file name and $line -- time of file …

Member Avatar for thekashyap
0
844
Member Avatar for LRNPHP

Hi All, I'm going crazy with this. I have a file called unique.txt with allot of values in. When I run my script it will add 1 value (1319613308.476855) to my value file but when I grep the value it displays nothing and I know the value is present in …

Member Avatar for LRNPHP
0
121
Member Avatar for koricha

can some body expaly me this command [CODE]sed -e 's/<[^>]*>//g' test > test.t [/CODE] thank you

Member Avatar for koricha
0
173
Member Avatar for java_programmer

I am trying to write a shell script which will read a file and counts the number of vowels in the file. The code which read the file is as follows - [CODE]while read -n 1 c do l=$(echo $c | tr [:upper:] [:lower:]) [[ "$l" == "a" || "$l" …

Member Avatar for java_programmer
0
187
Member Avatar for msrikanth

Hi Everyone, I need a replace a string (ex : this) with the string (ex : that) in each line of a file (sample.txt) using a C Shell Script and I am not allowed to use sed,awk and replace command in the unix , So i tried to use tr …

Member Avatar for histrungalot
0
7K

The End.