10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello,
I am searching the following string Folder^ in a file and replacing it with Folder^/
However if the file already contains Folder^/ I want to avoid replacing it with Folder^//
To do this I have to do the following today:
1) echo "Folder^" | sed 's/Folder\^/Folder\^\//g'
I get... (2 Replies)
Discussion started by: mehimadri12
2 Replies
2. Shell Programming and Scripting
I have the logic below to look up for matches within the columns between the two files with awk.
In the if statement is where the string comparison is attempted with ==
The issue seems to be with the operands, as
1. when " '${SECTOR}' " -- double quote followed by single quote -- awk matches... (1 Reply)
Discussion started by: deadyetagain
1 Replies
3. Shell Programming and Scripting
Hello Experts,
I am trying to compare two files line by line with below code. I want to ignore the spaces while comparing. Only content should be compared.
hostFile="/etc/hosts"
inputFile="/home/scripts/DR/hosts.eas"
grep -E '^{1,3}\.{1,3}\.{1,3}\.{1,3}' $inputFile > temp1... (9 Replies)
Discussion started by: sharsour
9 Replies
4. Homework & Coursework Questions
attempting the hangman program. This was an optional assignment from the professor. I have completed the logical coding, debugging now.
##I have an array $wordString that initializes to a string of dashes
##reflecting the number of letters in $theWord
##every time the user enters a (valid)... (5 Replies)
Discussion started by: lotsofideas
5 Replies
5. Shell Programming and Scripting
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies
6. Shell Programming and Scripting
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies
7. Shell Programming and Scripting
Hello All,
I am writing a file comparison utility and using the cmp command to compare 2file. But I need command that will compare 2 files and if the files are identical expect for differences in white spaces, then it should ignore those spaces and consider the two files equal. Is there a way to... (7 Replies)
Discussion started by: Veenak15
7 Replies
8. UNIX for Dummies Questions & Answers
Here is my problem. I have to find the differences in 2 XML files
This is my Old File contents - File1
<FILEHDR>
<Bag xsi:nil='true'></Bag>
</FILEHDR>
This is my New File contents - File2
<FILEHDR>
<Bag xsi:nil='true' ></Bag>
</FILEHDR>
When I do the following
diff -b File1 File2... (1 Reply)
Discussion started by: sksahu
1 Replies
9. UNIX for Dummies Questions & Answers
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies
10. Shell Programming and Scripting
Hi all,
I need help in doing this scenario. I have two files with multiple lines. I want to compare these two files but ignoring the lines which have words like Tran, Loc, Addr, Charge. Also if i have a word Credit in line, i want to tokenize (i.e string after character "
... (2 Replies)
Discussion started by: jakSun8
2 Replies