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. Shell Programming and Scripting
Hi guys,
New to the forum, and been messing around with Linux for about a year now. I'm still very much a rookie, so just assume that I'm a total idiot:
I currently have a shell that spits out a CSV number string of about 8 numbers as follows:
1.00,2.00,3.00 ... ,8.00I need to assign a... (7 Replies)
Discussion started by: hansol
7 Replies
3. Shell Programming and Scripting
I'm trying to write a basic bash script that takes input you give (what directory, if any, what name, if any ....) and passes the information to find.
I'm trying to just create a string with all variables and then pass it to find. So far I have this extremely simple:
#!/bin/bash -f
... (2 Replies)
Discussion started by: Starting_Leaf
2 Replies
4. UNIX for Dummies Questions & Answers
Hello,
Why is this not working in a script?
files="test.fsa"
echo $files
for file in $files
do
if
then
echo "$file does not exist."
fi
run a command
done
I get an error saying (3 Replies)
Discussion started by: verse123
3 Replies
5. Shell Programming and Scripting
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Discussion started by: lio123
25 Replies
6. Shell Programming and Scripting
Input:
MD5(secret.txt)= fe66cbf9d929934b09cc7e8be890522e
MD5(secret2.txt)= asd123qwlkjgre5ug8je7hlt488dkr0p
I want the results to look like these, respectively:
MD5(secret.txt)= fe66cbf9 d929934b 09cc7e8b e890522e
MD5(secret2.txt)= asd123qw lkjgre5u g8je7hlt 488dkr0p
Basically, keeping... (11 Replies)
Discussion started by: teiji
11 Replies
7. Shell Programming and Scripting
i need one help....
if i have a string like aaaaa,bbbbb,ccccc,aaaaa
How to to split the string and check howmany times aaaaa will be in that string?
Thanks (7 Replies)
Discussion started by: karthinvk
7 Replies
8. Shell Programming and Scripting
Hi all,
I have a file of around 300 lines in which string "SERVER" occurs around 32 times.
for eg.
I need to split files like, for eg
I am using this code
awk '/SERVER/{n++}{print > f n}' f=/vikas/list /vikas/final
But the problem is that it makes maximum of 10 files, but I... (12 Replies)
Discussion started by: vikas027
12 Replies
9. Shell Programming and Scripting
Hello,
I am an intermediate scripter. I can usually find and adapt what I need by searching through previous postings, but I'm stumped.
I have a string with the format "{Name1 Release1 Type1 Parent1} {Name2 Release2 Type2 Parent2}". It is being passed as an argument into a ksh script. I need to... (5 Replies)
Discussion started by: drd_2b
5 Replies
10. UNIX for Dummies Questions & Answers
I have a variable which consists of a string like this:
001 aaabc 44 a bbb12
How do I extract each substring, delimited by the spaces, into new variables - one for each substring?
eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc?
I've come up with this:... (2 Replies)
Discussion started by: Sniper Pixie
2 Replies