10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have a lookup table from which I am looking up values (from col1) and replacing them by corresponding values (from col2) in another file.
lookup file
a,b
c,d
So just replace a by b, and replace c by d.
mainfile
a,fvvgeggsegg,dvs
a,fgeggefddddddddddg... (7 Replies)
Discussion started by: senhia83
7 Replies
2. UNIX for Dummies Questions & Answers
Hi, I'm trying to get multiple substitutions in one expression using sed:
echo "-foo-_-bar--foo-_bar_-_foo_bar_-foo_-_bar_-" | sed -e "s//-/g"
So, as you can see I'm trying to replace all instances of _-, -_, -- with - (dash)
I have provided bad example. The question is how to use multiple... (6 Replies)
Discussion started by: useretail
6 Replies
3. Shell Programming and Scripting
Hello
How can write the nested command substitutions?
echo `expr substr $x 1 expr ${#x} - 1`
the above code is not working!
Thanks in advance
Regards
Chetanz (5 Replies)
Discussion started by: Chetanz
5 Replies
4. Shell Programming and Scripting
Hey everyone! I am determining the best method to do what the subject of this thread says. I only have pieces to the puzzle right now. Namely this:
grep -rl "expression" . | xargs open
(I should mention that the intention is to grep through many files containing the "expression" and... (2 Replies)
Discussion started by: Alexander4444
2 Replies
5. Shell Programming and Scripting
PHOST1=temp
i=1
I want to display the value of PHOST1 by making use of variable i inplace of 1
something like this
echo "$PHOST$i" # -> This doesn't seem to work.
Please provide me the correct syntax. I tried many different ways
echo ${PHOST${i}}
echo ${PHOST
Nothing seems... (6 Replies)
Discussion started by: blazer789
6 Replies
6. Shell Programming and Scripting
I am working on a bash script and ran around this issue. here's the code :
#!/bin/bash
string="\"bin\" \"barn\" \"bin, barn /\""
array=($string)
echo -e "\nMethod 1\narray is ---> ${array}"
echo -e "array=($string)"
array=("bin" "barn" "bin, barn /")
echo -e "\nMethod 2\narray is... (4 Replies)
Discussion started by: titou_dude
4 Replies
7. Shell Programming and Scripting
How can I nest substitutions ? My solution just seems cheap ...
sample data
Cisco Catalyst Operating System Software, Version 235.5(18)
Cisco Catalyst Operating System Software, Version 17.6(7)
Cisco Catalyst Operating System Software, Version 19.6(7)
Cisco Catalyst Operating System... (1 Reply)
Discussion started by: popeye
1 Replies
8. Shell Programming and Scripting
Hello
I have the following output which is returned with the Month in text format instead of numerical. The output I receive is performed by using Rational Synergy CM software commands from the Unix command line and piping Unix commands on the end.
bash-3.00$ ccm query -n... (4 Replies)
Discussion started by: Glyn_Mo
4 Replies
9. Shell Programming and Scripting
Hi all
I've been working on a bash script parsing through debug/trace files and extracting all lines that relate to some search string. So far, it works pretty well. However, I am challenged by one requirement that is still open.
What I want to do:
1) parse through a file and identify all... (3 Replies)
Discussion started by: reminder
3 Replies
10. UNIX for Dummies Questions & Answers
We need to scramble data in a number of ASCII files. Some of these files are extremely large (1.2 GB). By scrambling, I mean that we need to substitute certain strings, which number around 400, with scrambled strings. An example has been given below
If "London" occurs in the file, then it... (2 Replies)
Discussion started by: SanjivNagraj
2 Replies