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, 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
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. Shell Programming and Scripting
Hi,
I've been stuck for several days on this. Using grep on a command line, I can use quotes, eg...
grep 'pattern of several words' filename
I want to do this in my bash script. In my script I have captured the several command line arguments (eg arg1 arg2) into a variable:
variable=$@
I... (2 Replies)
Discussion started by: adrian777uk
2 Replies
5. Shell Programming and Scripting
Hello All,
I am learning BASH scripting and I would appreciate any help with a small problem I am having...
I am writing a script that builds a simple hosts file for DNS reasons related to a piece of software called netdb by parsing another application's config files for IP's and their... (4 Replies)
Discussion started by: Wesley545
4 Replies
6. 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
7. Shell Programming and Scripting
In my script I'm retrieving a parameter through an API call. I need to trim some things out of the result so I can use it as a parameter to pass to another process. I've got it working but it's pretty kludgy and I'm hoping someone can help me with a better way.
This is the code that retrieves... (2 Replies)
Discussion started by: withanh
2 Replies
8. Shell Programming and Scripting
Hello guys,
here is my problem:
I got a shell script which is called by an external piece of software, the external software is not under my control. The software passes data as an argument to my script like
./bla.sh 'service;1234567890;ok;hostname;some text here'
I need to pass the... (3 Replies)
Discussion started by: snoogie
3 Replies
9. UNIX for Advanced & Expert Users
Hi All,
I am using a bash shell and want to the following thing.
A process sends the following string to my script
BACKUP_FAIL_REASON="Failed - Application Dump CDMACA-0:grep: /opt/nortel/ca/data/1245184/sd00/image1/S110907070708HIS... (4 Replies)
Discussion started by: Pkumar Sachin
4 Replies
10. 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