1,978 Topics

Member Avatar for
Member Avatar for shroomiin

Hi. I have here a script which I had acquired from the net. I have tested it in a lab environment and it seems to accomplish my task perfectly. That being- to list each server in the domain, its services and the account the service runs under. Problem is- I …

Member Avatar for chriswelborn
0
167
Member Avatar for Somnath_1

I am trying to get two input from a file . #!/bin/bash echo "enter clientname" read clientname echo print|nsradmin -s $clientname -p390113|egrep 'NetWorker version|IP address'>> output_$clientname the content of the file would be : $ cat test_new1 NetWorker version: 7.6.3.2.Build.860; IP address: xxx.xxx.xxx.xx; I want to grab "IP address:" to …

Member Avatar for chriswelborn
0
215
Member Avatar for Wei_3

How to make Ctrl-Z work with xterm -e "ping localhost" there will be a child process but how to pass the Ctrl-Z to that process? I tried Ctrl-C and S and Q they are working fine...

Member Avatar for Mocabilly
0
120
Member Avatar for nravhad
Member Avatar for lovebird_huby

Could someone help me with a Shell Script OR a perl script which could read the below INPUT File and print output in format listed below. The logic I am looking for is to read each block within the asterisk line, then search for "until:". If the date of "until:" …

Member Avatar for griswolf
0
185
Member Avatar for zoollu

Hi, I am familiar with shell script but not really have much experience. I am looking into a shell script that would do this I have 2 tables TableA id name interest ---------------------------------------- TableB id name I have to create a shell script which copies all the id,name values from …

Member Avatar for ramu1211
0
876
Member Avatar for kuldeepJS

Hi, I am struglling to send an image in my email. In the program I am using the shell command sendmail in usr/lib/. I had set the content type to html/text. When I am writing the html tag <img src"<someimage>"/> in the body. The mail when sent is not having …

Member Avatar for hericles
0
123
Member Avatar for woodson2

What I would like to do is read each line in the atdinfile: A sample atdinfile would look like this: 651 652 653 654 655 656 657 658 659 660 661 664 665 666 667 668 I would like to grep through each atd job id looking for a match …

0
103
Member Avatar for jangojan

hie all i am in a phase of creating a hta application for our internal functionality of our company. basically the reqt is to embed a self devloped binary file in the hta file, but i am facing a problem. like where i should paste the base64 strings in the …

0
172
Member Avatar for whizkidash

Team, Can any one assist me with my below script requirements I log into a jump box with my login and password, Here I need to create a script which i will run from this point that will connect to a different server using ssh and it should prompt me …

0
175
Member Avatar for daChi

Hi there, my name is Brian. I am a software engineer whose most experienced in the Linux/UNIX shell scripting world. I also have a background in cloud computing (namely Amazon Web Services) and Java. I look forward to learning from and sharing with the Daniweb community!

Member Avatar for Dani
0
55
Member Avatar for chaitu11

I am transfering files from system directory to server directory which works perfect. But i need to run batch file after every half n hour. I need to make it as a **batch file** please help ftp -i 21.49.567.12 username password cd "uploads" lcd "c:\up" binary mput p* disconnect bye

Member Avatar for daChi
0
81
Member Avatar for toldav

Hi Guys, I'm new to awk and trying to format an stadout "temp.txt" to csv format so I can export to excel. I'm having issues here is my code so far..If any one can help to see the light!!! The ### sign is the second server on the list each …

Member Avatar for thekashyap
0
234
Member Avatar for nsiq

How to validate multiple inputs on a dialog form using shell scripting? Validations must be performed before submitting form or when focus shift to any other input field .

0
119
Member Avatar for westony

I am having this simple script: #!/usr/bin/expect -f set values "#host=CE101 #host=CE102" set found [regexp {[A-Z]{1,2}\d{2,3}} $values CE CE1] if {$found == 1} { puts "px is $CE" puts "vpx is $CE1" } else { puts "\nfailed to match anything from\r\n$values" } puts $found So my problem is that regexp …

0
130
Member Avatar for amavikmukherjee

[Click Here](null)Hello dani. I know how to write to a file using redirection. But I am unable to write a record to every new line. I want it this way alex amsterdam 800 7 But I am ending up putting everything in a new line, I mean the fields or …

Member Avatar for txernobill
0
362
Member Avatar for coding101

Not hot on sed.. I have the string <Report name="05/14/14 05:05:53 AM - Report"> in a file. I need to change the date and time part to the current date and time.. any sed regex to match the date format and timestamp?

Member Avatar for L7Sqr
0
152
Member Avatar for changeworld4u

Hi Team, I have a file which contain following data like BKP0000032183140217000019 053IGZYEVSDOX .........field 2....... field3.....field4..... BKP0000032284140217000019CCTP1220 ............... BKP0000032384140217000019CA ..................... each line has 5 fields Now using shell script i am trying to extract field 4 based on condition that line start with BKP and contain code 84 and CA …

Member Avatar for changeworld4u
0
288
Member Avatar for brakeb

I have been beating my head into the desk with this issue, and I don't think it's a simple 'uniq' or 'sort' issue. I have a file, with many duplicate values in them. File ---------- dog dog cat owl owl turkey weasel giraffe giraffe rooster The output I am looking …

Member Avatar for brakeb
0
196
Member Avatar for changeworld4u

Hi Team, I am new to shell script, i have knowledge of basic unix command but that doesn't seem working for my current task. Please help me with following problem: I have a xml file for e.g. <ShippingInstructions> <name>Sarah Bell</name> <address>400 Oracle Parkway Redwood Shores CA 94065 USA</address> <telephone>650 506 …

Member Avatar for rubberman
0
182
Member Avatar for gregarion

Hello All. I have an issue with string manipulation. The file which I am using has two lines : First String: 1 4 Second String: 5 4 What i am trying to do is while reading each line, i would like to store each variable in the line into 3 …

Member Avatar for rch1231
0
198
Member Avatar for TraderX

Hello all, I am by no means a coder, so hopefully someone has something they would be willing to share that would meet this need. I would like to have a Outlook rule, where: - When an email comes in from a specific account - Has an attachment (PDF, doc, …

0
181
Member Avatar for Shreerang

Hey all, I was wondering if a web page could be opened in Mozilla Firefox using a shell script!..I haven't given it a try as yet...I will also try and if I find a a solution I'll definitely put it up....Till then if someone finds a solution or knows it …

Member Avatar for daye_1
0
4K
Member Avatar for RikTelner

@echo off set /p Pause=Before >nul set /p Pause=After (@edit Before `>nul` there supposed to be sign, but it's not visible in post.) What does this script do, is print "Before" wait till user presses enter, "Bleeps" and prints "After", after pressing enter application stops. But output is: '' is …

Member Avatar for RikTelner
0
187
Member Avatar for Miroslav Mizner

Hi everybody! These days I've been solving the task of sending the bunch of files specified by unix filespec convention (all metacharacters allowed) to the remote host using ftp. I'm thinking of such concept/design, where the main bash script executes the following subtasks: (1) Expansion of command line arguments to …

Member Avatar for mizoslav
0
878
Member Avatar for AwkRocks

Hi Friends. I am trying to conver the following grep syntax to replace using awk pattern match. Can you please help? tail -F $logFiles | grep " ERROR " | grep -v 'ERROR_SERVER \|Session is null for endpointId\|SYNCED_IN_VIEW_UPDATED'| cut -d" " -f10-14 | awk 'BEGIN..............}' I am seeing some buffering …

0
151
Member Avatar for John_Peter

I want to have one .bash_profile works on multiple platform, ubuntu, debian, redhat, cygwin, osx. So how should I organize .bash_profile? It can be multiple files in some subdir Let me brief you: what i want is a way to organize bash_profile across platforms so I can use one set …

Member Avatar for JeoSaurus
0
162
Member Avatar for Cap'nKirk

Hi, I have a snippet of batch code that searches through a folder and outputs the results one file per line in html format. Code below: @ECHO OFF &SETLOCAL (FOR /f "delims=" %%a IN ('dir /b /a-d /s /n "C:\Documents and Settings\All Users\Documents\My Pictures\Pics & Vids"') DO ( FOR /f …

Member Avatar for rojomoke
0
175
Member Avatar for Alan_4

Write a shell script that will take a filepath and a string as command line arguments. The script should find lines which contain the given 'string' in the given file. It should create an output file in "/tmp" directory with the name in the pattern as below. "NN_15Nov2013_12Hrs_32Minutes_20Seconds.txt"

Member Avatar for cmk001
0
399
Member Avatar for AwkRocks

Input: Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Provisioning exception while parsing protocol Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Failed to extract text from response Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Error while loading make model Feb 15 2014 10:31:00 ERROR {http--0.0.0.0-0000-000} …

Member Avatar for AwkRocks
0
171
Member Avatar for divakar.it

Here is my another challenge. When I pass the file name into for loop, I want to get a specific word from the file name and need to pass that as a parameter as well. For eg: When there are 5 files in a folder say Encrypted_abc_1.xml Encrypted_xyz_2.xml Encrypted_hij_3.xml Encrypted_klm_4.xml …

Member Avatar for divakar.it
0
240
Member Avatar for Ancient Dragon

How did the link get into [this post](http://www.daniweb.com/software-development/shell-scripting/threads/474195/file-in-unix#post2070691)? The op said he/she didn't put it there.

Member Avatar for Ancient Dragon
0
106
Member Avatar for srinivas88

Hi, I need to monitor the ip addresses in a server. whenever there is a fluctuation, i need to do some clean up (like restart the server/ reboot the machine) I was able to get a sample cpp program & was able to enhance it to suit my needs. But …

0
172
Member Avatar for Madira

I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb msgid "" hsdvchgsdvc msgstr …

Member Avatar for Madira
0
373
Member Avatar for Valkrem

Hi all, I want to write a script to do the following job I have a record like day ID var Month 1 11 x March 2 11 y April 3 11 y March 4 11 y April 5 11 y March 1 22 y April 2 22 x march …

Member Avatar for L7Sqr
0
101
Member Avatar for bobwahler

Win 7 clients, Need to populate alternate IP with current DHCP assignment (I believe everything else will be static). It appears that PowerShell is the only way to get at the alternate IP config variables. We are wrestling with a TechRepublic PS module that could be the modified. I used …

Member Avatar for cgeier
0
285
Member Avatar for theashman88

By examining the first, third and last (seventh) fields of the /etc/passwd file, determine the userid and login shell for your username, the user root, and the user nobody (yes, there is a system user with the username "nobody"). Create simple files in your home directory, called my.uid, my.shell, root.uid, …

Member Avatar for rch1231
0
292
Member Avatar for CPT

First, to explain what I want to do: I have a folder structure like this: BSDS300\images\test\ -which contains JPEG files, and some other files(only .jpg files are of interest) BSDS300\human\color\ -which contains many folders, in which I have .seg files with the same name as the .jpg file Example: BSDS300\images\test\3096.jpg …

Member Avatar for RikTelner
0
374
Member Avatar for Alan_4

Write the Towers of Hanoi program as a shell script. There are two basic strategies: run the shell script recursively as $0, or write a recursive shell function.

Member Avatar for rubberman
0
244
Member Avatar for singularity~

I have no clue to why this isn't working but when I try creating a shell path variable in `/etc/bash.bashrc`. This is my variable `SCHOOL="/home/stephen/Steve's\ Stuff/School"` When I type `$SCHOOL` into the terminal I get `bash: cd: /home/stephen/Steve's\: No such file or directory`

Member Avatar for rubberman
0
226
Member Avatar for Bhargav_2

Hi Can anyone help me out in this. Actually, I have rows like **Bold Text Here** 50121 abc.com 28/1/2014-12:00:00 52111 xyz.com 27/1/2014-12:00:00 deusr abc.com 26/1/2014-12:00:00 50121 abc.com 26/1/2014-12:00:00 52111 abc.com 25/1/2014-12:00:00 I removed the duplicates based on first column and got the output as 50121 abc.com 28/1/2014-12:00:00 52111 xyz.com 27/1/2014-12:00:00 …

Member Avatar for rch1231
0
139
Member Avatar for Cap'nKirk

Hi all, I am having a play around with batch files but have hit a stumbling block. The file returns the contents of an image folder and outputs the results in html format as such: Thumbnail - Filename (usable link) - Creation Date - Modified Date Please bear in mind …

Member Avatar for Cap'nKirk
0
225
Member Avatar for supra

Hello Everybody, I want to do a project on Linux Shell Programming for my final yr.Can any one give me some idea about what kind of projects I should choose (do) which have industrial relevance and certainly helps in campusing. Thaking you, Supra

Member Avatar for peter_14
0
802
Member Avatar for zulabc

I am a beginner for shell script, and I want to know how to check the content of file using if condition I have a files content .txt and what I want is if content of file have .txt; then skip else run code fi

Member Avatar for Snadiger
0
192
Member Avatar for nano72

i have the following scenario want to run the following script with manadory and optional arguments inside a bash script Manadory options are : filename="" port="" optional arguments type -t [A/B] balances -b bal prices -p ./test filename port -t A -b bal my code i have that won't parse …

Member Avatar for cfajohnson
0
741
Member Avatar for lewashby

echo ${NUM:0:2} The above is just an example of the kind of code I'M using. I need a way to represent the end of the string. Is there a way to start from the right side of a line of text instead of the left? What I'M trying to do …

Member Avatar for cfajohnson
0
203
Member Avatar for timetraveller1992

I'm trying to get the date to work properly. The time is 5 pm (1700 hours) now i.e. evening but it always says morning. Here's my code currenthour="$(date "+ %-H")" echo $currenthour if [ $currenthour -gt '12' ] && [ $currenthour -lt '16' ]; then currenttimeofday="Afternoon" elif [ $currenthour -gt …

Member Avatar for cfajohnson
0
183
Member Avatar for johnson gbenga

i need help Am written a script to solve my manual labor of cloning in my environment i want to use for statement to give me this kind of output Script for i in 0-4 && j in a b c d e do echo " $i $j this is …

Member Avatar for cfajohnson
0
180
Member Avatar for PriteshP23

Hello, I have one big XML file (600 MB - 850 MB) in format "**cells_yyyymmdd_hhmi.xml**" I would like to specify that everyday i will have new file with new date. So, *there should be general way to read it and cut it*. For exmaple, i have file of 7th January. …

Member Avatar for rubberman
0
262
Member Avatar for MadJako

Hello, I’m trying to make a powershell script that will copy files to and FTP server, but the destination folder needs to be generated each time the copy starts. In lieu of having a ton of issues trying to copy the source folder onto a remote FTP site using powershell, …

Member Avatar for Paul.Esson
0
1K

The End.