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
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
5. Programming
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies
6. Shell Programming and Scripting
Is there anyway to accomplish this?
(ksh)
FILES_TO_PROCESS='NAME1 NAME2'
SOURCE_NAME1=/tmp/myfile
TARGET_NAME1=/somewhere/else
# other file names
for i in $FILES_TO_PROCESS
do
file1=SOURCE_$i
file2=TARGET_$i
echo cp ${$file1} ${$file2} <-- how do get this to work.
done (2 Replies)
Discussion started by: koondog
2 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 guys,
Is there any way this can be done, or return whether any substitutions have been made?
thanks for any input.
skinnygav (using Bash shell) (2 Replies)
Discussion started by: skinnygav
2 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