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
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:
I need to "sed" my variable... (3 Replies)
Discussion started by: Hornys
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:
... (2 Replies)
Discussion started by: Starting_Leaf
4. Shell Programming and Scripting
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:
I... (2 Replies)
Discussion started by: adrian777uk
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
Why is this not working in a script?
for file in $files
echo "$file does not exist."
run a command
I get an error saying (3 Replies)
Discussion started by: verse123
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
8. Shell Programming and Scripting
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
9. UNIX for Advanced & Expert Users
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
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