10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
So im trying to search for the most recent occurance of a string in the most recently updated .log file in a certain directory. The string i am searching for is a value, now if this value is greater than 800 i would like an email sent out with some text (blah blah blah).
This is what... (7 Replies)
Discussion started by: hello_world
7 Replies
2. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
3. Shell Programming and Scripting
I would like to use sed to store a variable.
The code is :
echo $HEADERREC
CUTVAR=$(echo "$HEADERREC"|sed 's/SDV/STR')
echo $CUTVAR
Output I am getting now:
0012PVGRSCDVSDV 005 00000000000000000000 2014 0.00
sed: Function s/SDV/STR cannot be parsed.
Desired... (5 Replies)
Discussion started by: MIA651
5 Replies
4. Shell Programming and Scripting
Hello
I have a script:
path=test1
echo "${path%?}"
till this the program is successful in deleting hte last character i.e. "1" and displays an output --> test. After this how can i save this output to another variable. (2 Replies)
Discussion started by: Kishore920
2 Replies
5. Shell Programming and Scripting
I have a file having some text like:
PATH_ABC=/user/myLocation
I have to replace "/user/myLocation" with a session variable say, $REPLACE_PATH,
where $REPLACE_PATH=/user/myReplaceLocation
The following sed command is not working. It is writing PATH_ABC=$REPLACE_PATH in the file
... (2 Replies)
Discussion started by: SKhan
2 Replies
6. Shell Programming and Scripting
I am writing the code in perl.
I have an array in perl and each variable in the array contains the data in the below format
Now I need to check the below variable w.r.t system month I need to store the date and time(Tue Aug 7 03:54:12 2012) from the below data into file if contains only 'Aug'... (5 Replies)
Discussion started by: giridhar276
5 Replies
7. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
8. Shell Programming and Scripting
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies
9. Shell Programming and Scripting
Dear friends, Please help me to resolve the problem below,
I have a file with following content:
date of file creation : 12 feb 2007
====================
= name : suresh
= city :mumbai
#this is a blank line
= date : 1st Nov 2005
====================
few lines of some text
this... (7 Replies)
Discussion started by: swamymns
7 Replies
10. UNIX for Dummies Questions & Answers
Hi ...
I have a string variable
STR = "This is a test message"
I have a file abc.txt that I am searching for the occurence of the string STR ...
I am using the command in a script
cat abc.txt | grep $STR
It identifies each space as a seperator and prints word by word.
How to... (2 Replies)
Discussion started by: mattrix
2 Replies