1,891 Topics
![]() | |
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 … | |
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 … | |
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 … | |
I need to remove all lines that contain spaces in a file. I know very little bash. Any help would be greatly appreciated. | |
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 … | |
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? | |
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:) | |
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 … | |
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. … | |
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 … | |
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 … | |
hai dani, i have a problem with listing the contents of file in another directory. my default path is in /home/pallu where my file called DirProg script exists , now i want to find any file which starts with a or A in a dir and store the content in … | |
can anyone modify my code to make it recursive search of subdiretories, currently this code only can search of particular directory. #!/bin/bash if test $# -eq 0 ; then echo usage: "${0##/*} [Dir name]" exit fi for arg in $* ; do if test -e $arg ; then maxLen=0 # … | |
Hello dear people, I have a bit of a problem, I need to change something and I am not sure how. I need to change (see: Codification) To look like. [[Codification]] Of course the word codification can also look like (see: PrimaryLegislation) And then it needs to be [[Primary Legislation]] … | |
![]() | Hi guys, I've come to a road block so i need some help. 1)I have an exe which i need to run at start up. So I put the following bash file in the inid.d directory: [code] #!/bin/bash # # . /etc/rc.d/init.d/functions EXE_DIR="/root/monkey-0.9.2/bin/" EXE_NAME="monkey" ############################################################# #################### Functions ############################## ############################################################# function … ![]() |
Hi, can anyone please help me on this. I dont understand as to why am getting this error.. Please, please help on this! fortesting purpose I have commented certain lines.. [CODE]"Pre_s2a_leadtime.sh" 55 lines, 1233 characters #!/bin/csh # Check if program is already running and echo a time stamp for the … | |
Hi, I am using a set of tools called FWTools which runs commands in the shell window. One command that I am using edits tif files by adding an overview to the file. The syntax is: gdaladdo -r average "D:\Map Files\Tiffs\ST00.TIF" 2 4 8 16 32 What I need to … | |
I have a problem with the Nesting of case statements. This is a Simple restaurant program which simulates food ordering. I used Case statements to Display Multiple nested menus base on the users choice But i seem to have a problem with the esac,seems my nesting is wrong.Pleas any help … | |
I am a beginner in shell programming in Unix. My current problem is log file analysis based on a given time range for listed dates. The file is a long file and I need to sort IPs based on a user input through terminal. For example, from the end of … | |
What am I doing wrong? [code=bash]for filename in /home/darragh/public_html/test/* do sed -i 's/..\/config/.\/config/g' done;[/code] It just gives me: sed: No input files | |
Hello, I'm new in shell scripting and i face some problems. I need your help to calculate a logarithmic expression in shell script for example i have 2 variables x1 x2 $x1=3 $x2=5 $Result=`expr x2 * log2 x1` ???? $echo "Result is $Result I know that this is wrong and … |
The End.