Search Results

Search: Posts Made By: sirtrancealot
5,938
Posted By sirtrancealot
Hi Hitori & all well I did some reading as...
Hi Hitori & all

well I did some reading as you suggested, however from the link below (http://www.student.northpark.edu/pemente/sed/sedfaq4.html#s4.30)
and the just to clarify, the correct way is...
5,938
Posted By sirtrancealot
Nice one - the single quotes around the variables...
Nice one - the single quotes around the variables has worked. thanks
5,938
Posted By sirtrancealot
Variables within a sed statement
I am just wondering if it's possible to refer to variables within a sed statement as follows:-

cat $file | sed -e 1's/$oldtext/$newtext/' > $file

as when I run the script, the variables are not...
4,414
Posted By sirtrancealot
Simplifying the For loop
Is there a way to simplify stating 1 through to 10, for example in a for loop construct?

for x in 1 2 3 4 5 6 7 8 9 10
do
....
done

I have tried [1-10] (1-10) with no luck.. thanks
5,009
Posted By sirtrancealot
Thanks shereenmotor, adding ` ` around the awk...
Thanks shereenmotor, adding ` ` around the awk statement allows the variable to take the result value of that statement.
4,178
Posted By sirtrancealot
Thanks for the responses Jim and vgersh99. ...
Thanks for the responses Jim and vgersh99.
Your moving of the / / of my line works thanks vgersh99.
5,009
Posted By sirtrancealot
Ah ok, my file only has one column per line in...
Ah ok, my file only has one column per line in any case, so it is not an issue here.
5,009
Posted By sirtrancealot
Assigning a value to variable
Another newbie to Unix scripting Q..

How do you assign a value resulting from a command, such as awk, to a variable.

I am currently trying:-

$awk '{print $1}' file1 > variable1

with no...
4,178
Posted By sirtrancealot
Extracting specified line from a file using awk
Hi,
I am just trying to extract a line at a time from a file using awk and can't yet extract even the first line using the following:-

awk '/(^[a-zA-Z0-9]) && (NR==1)/ {print $1}' file1

Is...
8,265
Posted By sirtrancealot
Strange, neither of the ways work on my sed...
Strange, neither of the ways work on my sed version..? although it does say in the info page - version 3.02 of GNU Sed.
8,265
Posted By sirtrancealot
Inserting a carriage rtn in a sed cmd
I suppose this is a silly newbie Q, but I have a set of text I am inserting into a file using a sed cmd and before I insert, I want to ask the sed operation to move to add a carriage return first,...
3,713
Posted By sirtrancealot
Thanks Jim, just the inclusion of {} around the...
Thanks Jim, just the inclusion of {} around the 'for' makes the statement run correctly now.
3,713
Posted By sirtrancealot
For Loop iterations
I have a silly beginners question here:

I'm running a for loop within an awk command as follows, however the loop only runs once, instead of 2 through to 11 and then terminating. As the output to...
Showing results 1 to 13 of 13

 
All times are GMT -4. The time now is 09:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy