1,891 Topics
| |
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 … | |
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 | |
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 … | |
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 … | |
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] | |
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 … | |
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! | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 $ … | |
Hi Team, I am stuck in a very tight situation.. need your help The below script does not work even please let me know where is the problem and rectify me. Script as below: replace.sh [code]#!/bin/bash file_name=$1 old_templet=$2 new_templet=$3 for file in file_name do cat $file | sed "s/old_templet/new_templet/g" > … | |
Hello all. New here. Another student looking for a little help. Technically I wouldn't consider this a homework question, as it is part of a much larger project for my class. My professor is little help so I'm here now. I hope you can help. I have a text file, … | |
Hi team, Well i have been asked to make use of automation scripts for my host production box.. .And i hope u will help me with the same. #script as below: a)when i run script it should ask the person to key in..(means should be interactive) b) it should search … | |
Hi All, I am new in SFTP. 1)I need to transfer the file from one server to another server. 2) I have written .com file in my ALPHA VMS system with SQLquery. 3) Usually I send .com file through NDM protocol. In this file i write NDM script in the … | |
I have declared a variable: [icode]today=$(date +%m/%d/%Y)[/icode] and I am trying to use sed to replace the word "in" with "out:date:name" but don't know the correct syntax to make $today print correctly. I have tried quotes and double quotes and brackets but to no avail. When I do it like … | |
The problem I'm having is that I want to read in whether the user wants to keep the spelling or change it, but the "read spelling" pulls from the 'line' and not from user input. my assignment description is as follows. Write a shell script that implements an interactive spell … | |
Hi, We are taking backups for ldap instances, and with the new requirement would like to keep 1 day's of backup to local disk (/export1) and rest 14 days backup to SAN (/export2). Now we are in kind of fix on how to move the backups ( includes files & … | |
hi, basically i am trying to write a quick script to remote copy something as follow. "" scp [email]user@192.168.1.5:/var/tmp/file.txt[/email] /var/tmp/newfile.txt "" if i do above cmd on the shell, i will be asked for password: my question is, how i do automate the password part within the shell script to … | |
Can any one please let me know how to connect to oracle retrieve data and work around the data through shell script. for example i have to get salary of 5 employees and add 500 to them and print them. thanks a ton in advance. Sriram | |
Can anybody help me with a unix script project that I have no clue on starting it, and also I 'm not that much familiar with unix scripting. Don't get me wrong have little bit experience with Linux, but when comes to script I'm just a beginner. If any someone … | |
Hi everyone, In part of my script, I'm trying cut out couple of columns from the df -h command. The ones I want is the Filesystem column and the Mounted On column. This is what I have so far. [CODE]df -h | cut -d " " -f1 [/CODE] And that … | |
Hi there, I have a unsolved problem here...my scripting do not go as I want, actually I want it to be solving the password in 10 seconds, but my scripting is run the timer and then only run the password solving.... anyone got any idea how to combine it?? [code]#!/bin/bash … | |
hi all, I have this file [myfile.txt] with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24| aera|bprb|male|cccc|pppp||15000|20| . . . // and so on So what I want to do is to take out (to a file) the missing fields as following format: <FName> <LName> <Company> Missing … | |
Alright I admit, I hate AWK. Heck even my C++ class is making more sense at the moment. I have a strong suspicion that this is a language I will learn and never use again after this class, as everything else seems better/more intuitive. But maybe that's just me. I'm … | |
I just joined and I am new to scripting. Please can some one help me to put links to a file that has been already sorted. code below. grep -i $1 *html */*html | sed -e 's|<|.|g' -e 's|>|.|g' | sort | uniq -u >>output_file I need to put links … | |
Hi, I am not really good at shell scripting. I usually cut and paste from other scripts and customize it to do what I need. I am running Oracle 10g on AIX 5.3 machine and I need a script that does monitors a filesystem, I would say at least every … |
The End.