10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi. I'd like to remove all values in a string variable that also exist in a second variable. What is the appropriate approach to take here? I can use a 'For' loop and check each element and then populate a new string. But is there a cleaner, simpler way?
E.g. I have the following 2 variables ... (19 Replies)
Discussion started by: user052009
19 Replies
2. UNIX for Dummies Questions & Answers
Hello unix.com
I'm having trouble with a text file.
It looks like this:
Alvaro Costa Daldit Kaur Sings Brian G Heward
Desmond Ogilvie John Der William Gherasim
Lance Mackey Donald Kopplin Robert Mckinlay
Jahir Hussain Mohamed Jack Benaim Abraham Weiss
I want... (7 Replies)
Discussion started by: galford
7 Replies
3. Shell Programming and Scripting
Hi, I have a variable with grep output like this:
WORDS=$(grep -r -c -i -E "palindrom" /"$DIRECTORY"/)
so "echo "$WORDS"" could be:
//directory/file1.txt:0
//directory/file2.txt:0
//directory/file3.txt:3
//directory/file4.txt:1
//directory/file5.txt:0
I need to "sed" my variable... (3 Replies)
Discussion started by: Hornys
3 Replies
4. Shell Programming and Scripting
Hi,
I want to update the file with a value at a particular position
$cat test.txt
COL1=TEST
COL2=
COL3=AADSDFSDFDSFDFDF
I want to update the file with a value for COL2.
After update, the file should be like this
$cat test.txt
COL1=TEST
COL2=1
COL3=AADSDFSDFDSFDFDF
here 1... (9 Replies)
Discussion started by: vedanta
9 Replies
5. UNIX for Dummies Questions & Answers
Hello
I am currently having problems in mapulating a certain file which contains vaious data.
Belos is a sample content
Event=<3190>
Client IP=<151.111.11.143> DNS=<abc.sbc.com> TransCount=<139>
Client IP=<150.222.133.163> DNS=<xyz.yuu.com> TransCount=<3734>
Event=<3120>
Client... (11 Replies)
Discussion started by: khestoi
11 Replies
6. Shell Programming and Scripting
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies
7. Shell Programming and Scripting
In a bash script I've set a variable that is the directory name of where an executable lives.
the_dir=`dirname $which myscript`
which equates to something like "/path/to/dir/bin"
I need to cut that down to remove the "bin" so I now have "/path/to/dir/".
This sounds easy but as a... (2 Replies)
Discussion started by: Witty
2 Replies
8. Shell Programming and Scripting
First of all I am VERY new to this so bare with me and try and explain everything even if it seems simple.
Basically I want to read a line of text from a html file. See if the line of text has a certain string in it. copy an unknown number of characters (the last 4 characters wiil be ".jpg" the... (1 Reply)
Discussion started by: c3lica
1 Replies
9. Shell Programming and Scripting
I need to achieve the following.....I seached the forum but could not find it...
This is I have in a file...
"CH","TIA","10/27/2006",000590
I need the date in the third field to be attached to fileas 20061027_test.txt
How do I do it. (6 Replies)
Discussion started by: mgirinath
6 Replies
10. UNIX for Dummies Questions & Answers
hi,
i have got a table with n number of rows and 2 columns..how can i get get 1 row at a time using any unix command without copying to any file?
Thanks and Regards
vivek.s (13 Replies)
Discussion started by: vivekshankar
13 Replies