sed script
Hi,
I want to put my sed code into a script: sed -n '/\(DREQ,\).*,0410/p' logs/2013/* I want to make the 0410 into a variable declared outside of the script and also be able to run the script on any location choosen outside the script, any advice please? |
Quote:
Since you don't give us any details about the script or what you're trying to accomplish, or why you're using two scripts, it's hard to say. |
I found this discussion to be very helpful after reading the original question.
|
Quote:
the script is used to look for 4 digit numbers in the following log file location SAC_LOGS/2014/* My script now takes in the value from (read) value, see below. However i cannot make the location dynamic, i want to define the location outside of the script. LOCATION=$1 echo -n 'Enter number to search ' read value sed -n '/\(DREQ,\).*,"$value"/p' $LOCATION |
Quote:
|
Quote:
Quote:
Second, did you read the link that dijetlo sent you? The one that has several examples on how to do what you're after? |
All times are GMT -5. The time now is 04:40 PM. |