1,817 Topics

Member Avatar for
Member Avatar for milanese

Hi, I am very new when it comes to batch files and I need to copy some files from a directory to another on a windows 2003 server. I have writeen a simple batch file which looks like this: [code]@echo off SET Day=%date:~0,2% SET Month=%date:~3,2% SET Year=%date:~6,4% SET cdate=%Year%%Month%%Day% SET …

Member Avatar for Aia
0
111
Member Avatar for MrHooper

Hello, I am new to shell scripting and am having some trouble writing a script that will work the way I want it to. I am good at the one liners, but when I try to string them together I get errors. I have a ftp server that will trigger …

Member Avatar for MrHooper
0
149
Member Avatar for chrisp200

What I am trying to do is use to retrieve information from a .txt file and use it in a drop down menu. I am using Cgi and not sure exactly how you do it. This is the shell script that will abstract the information I need for the drop …

0
82
Member Avatar for NewbieProgram

My professor wants us to write a script that will do the following: -Catch him online and output the time/day -Where did he login, ie College or Home (ip address provided is ok too) -What was he doing The crontab should run every 30 mins and automatically email him all …

Member Avatar for sknake
0
121
Member Avatar for Mattpd

I need to grep a line from a text file, and delete the fourth and fifth field. then save it back to the text file. If that wont work I could also grep the line, and delete the first number and everything after it on that line. Both would accomplish …

Member Avatar for hichnam
0
150
Member Avatar for Beencountry

Hey guys, Im in a basic programming class. Mainly using VBS scripting nothing else on Windows XP. All of the sudden my prof gave us this assignment for shell scripting. I don't know hardly anything about this. Objective: Create a single shell script in Windows/Linux that will do (all) the …

Member Avatar for cfajohnson
0
78
Member Avatar for railmaster7

I'm having trouble with some syntax errors, and also wanted to get an opinion of what I've written will work as needed. I'm writing an awk report script to organize data from a file and calculate the amount of sales. There are 3 kinds of lines that we will need …

0
61
Member Avatar for isxrc

Hi, I urgently need help with an assignment I must complete by tomorrow. I started Bash Scripting yesterday so am a complete newbie. I don't have time to teach myself Bash scripting so please don't redirect me to some tutorials. The assignment I have to do involves the following: the …

Member Avatar for Aia
0
111
Member Avatar for naziatarannum

Hi All, Please advise.. I need to create a script that keeps track on the number of times a file is accessed in a day. Can we use events/triggers if any.. If a file is accessed, then event should increment the count variable. I need to know more on events/triggers …

Member Avatar for peter_budo
-1
103
Member Avatar for roadwarrior

I need to remove all lines that contain spaces in a file. I know very little bash. Any help would be greatly appreciated.

Member Avatar for sknake
0
63
Member Avatar for srujanasadula

i have a file a.txt which contains "ysm.set.ac4-qa.sds.audit add yinst setting yti. YTI_ HOST_OVERRIDE =qa-sav-midas-002.ysm.ac4.yahoo.com" I have variable STR which is dynamically assigned the value "HOST_OVERRIDE=qa-sav-midas-002.ysm.ac4.yahoo.com" I need to grep $STR on the file a.txt as `grep "$STR" a.txt ` But because of the spaces before =, the line is …

Member Avatar for issue9
0
100
Member Avatar for Goddan

Hello! I have another issue that i cant solve. How do i search after a string in a text file and remove it when it get a match?

Member Avatar for issue9
0
155
Member Avatar for Goddan

Hello! Im rather new to linux and scripting i have a small question. Will this syntax work read $hitta | grep '$hitta' nummer.txt ;; I was planning to read the input from the user and use grep to find it from the file nummer.txt It dont work so well:)

Member Avatar for issue9
0
50
Member Avatar for Chowley

Hello. I cannot for the life of me figure this out. It was all running fine until i added another while loop for the directory part, same as the first one. Then i removed the loop and started getting this error. syntax error near unexpected token `fi' I have an …

Member Avatar for Chowley
0
538
Member Avatar for srujanasadula

A string variable taking any kind of string has a value "yjava_jboss.log4j_file_appender_pattern_layout='%d .//- %x %-5p [%c] %m%n' " at some point of time during execution. It is to greped on a file that contains with value. I used grep "$STR" <filename> ,where STR during execution takes value as shown above. …

Member Avatar for srujanasadula
0
126
Member Avatar for aliyesami

here is the thing i am trying to do . I have a system variable called $OOCEA_INCOMING_READY, I want to be able to construct this variable name inside the script and use it. I am passing part of the variable name OOCEA as parameter but i am not able to …

Member Avatar for masijade
0
123
Member Avatar for guest7

Hi, I am trying to replace the old_string with the new_string using sed. But i am unable to do it using the following script. [CODE]#!/bin/sh old_string="p cnf 10 20" new_string="p cnf 98 99" sed -e 's/old_string/new_string/' file1.txt > file2.txt [/CODE] Contents of file1.txt [CODE]p cnf 10 20 1 2 3 …

Member Avatar for chrislee.980
0
92
Member Avatar for naziatarannum

Hi all, I have a simple question as it appears. But am unable to get the solution. Question is -how do I get the access time of a file in unix. please advise on the command. Thanks

Member Avatar for Aia
0
105
Member Avatar for contactnaveen

I want a shell script program for this purpose and here is my requirement. I have two files 1.txt and 2.txt In 1.txt I have the following contents: label.abcd.1 = asdfgf label.abcd.2 = qwerqwe label.abcd.3 = zczxvzx label.abcd.4 = ;lkjj;l label.abcd.5 = pupoiup and in 2. txt I have the …

Member Avatar for issue9
0
216
Member Avatar for Mattpd

My ultimate goal is to fill an array with user inputted positive and negative numbers. This script I wrote is very limited, but it should give you an idea of what I am trying to do. Basically, I ask how many numbers and then reserve 3 spaces for each number …

Member Avatar for Mattpd
0
182
Member Avatar for Mattpd

I am trying to delete any line of text that contains "$npname" and the word "in." The script works if $npname is only one word, but if it is more than one work I get "error: unterminated address regex" How can I fix this? [CODE]sed '/'$npname'.*in/d' parts.txt > parts.tmp[/CODE]

Member Avatar for Mattpd
0
4K
Member Avatar for nimesh g

Problem: Software Versioning Problem Type : Complex ABC corp. makes a large range of softwares. They always need to distribute new patches and updates to their existing users. The updates may have dependency on earlier versions and hence the update process may vary for different users, depending upon which version …

Member Avatar for masijade
0
173
Member Avatar for naziatarannum

Hi, Please help in this regard. Can the modification time of a file be updated to any date of our choice? Please advise. Thanks in advance!

Member Avatar for naziatarannum
0
109
Member Avatar for naziatarannum

Hi, Am new to shell scripting. Please advise me as to how to write a shell script that checks a set of files under a directory, if the files are not updated/modified today then an alert mail should be sent to certain mail id. Please help. Am new to this …

Member Avatar for naziatarannum
0
141
Member Avatar for raigs

I'm trying to make a simple search script but cannot get it right. The script should search for keywords inside files. Then return the file paths in a variable. (Each file path separated with \n). [CODE]#!/bin/bash SEARCHQUERY="searchword1 searchword2 searchword3"; for WORD in $SEARCHQUERY do GREPINPUT=$GREPINPUT" | grep --ignore-case --files-with-matches -e …

Member Avatar for Kruptein
0
106
Member Avatar for whizkidash

Hi Team, Need your urgent help for the same Well i have a file which consist of million records. Question is : Prepare a script which will cat that particular file..and then,the user will be asked to choose which line in the file he needs to modify the word and …

Member Avatar for sknake
0
188
Member Avatar for whizkidash

Hi Team, I have multiple shell scripts created(already prepared), but my Project Manager insisted me to run/call the script as one script.. eg: Script1-"It finds whether file exist or not" Script2-"It replace a word in a file" Script3-"it searches the line and linenumber of a file" i need to run …

Member Avatar for sknake
0
211
Member Avatar for asulli01

Hi All, Im writing a ksh script that prompts the user for a path, then I want to use that path to deploy software to. There will only ever be 2 paths the user will select. My problem is that the script takes the path but doesn't substitute it into …

0
71
Member Avatar for Mattpd

If I have two lines of text: HOOK HOOK HOOK what is the syntax to grep just the first line without the second? and the second without the first?

Member Avatar for Xydric
0
119
Member Avatar for Hilliard

Hey guys, Just trying to do a simple shell script to generate a query line... can someone tell me why this does not work? [CODE]for e in `cat file.txt`; do echo INSERT INTO \`omstest_omstest\`.\`GEN2_FIELD\` VALUES \(NULL, '$e', '$e', '4', '2009-10-05 00:00:00', '0' '0'\)\;; done;[/CODE] if you take out the $ …

Member Avatar for sknake
0
186

The End.