Search Results

Search: Posts Made By: piynik
2,439
Posted By piynik
your code seems to parse all the names to the...
your code seems to parse all the names to the variable $name at the same time, would it be possible to parse the name one line at a time to variable $name in a loop, until it reaches the empty line?
2,439
Posted By piynik
so in that text file, it contains a list of names...
so in that text file, it contains a list of names starting from the 3rd line, of which I don't know how many there will be (different each run), until it ends with an empty line, followed by other...
2,439
Posted By piynik
Thanks Jotne...but I don't know what name1-4 will...
Thanks Jotne...but I don't know what name1-4 will be so I don't think that command will work...

Thanks Scrutinizer....could you explain your code? also I won't know how many names there are so...
2,439
Posted By piynik
Read in specific lines in a file
I have a text file


First title line

name1
name2
name3
name4
(etc)

other lines
other lines
other lines


I want to read in this text file and parse the name1...name4 to a...
3,695
Posted By piynik
Thanks DGpickett but I have no idea what you...
Thanks DGpickett but I have no idea what you talking about lol
3,695
Posted By piynik
Hi DGPickett I have just come across the...
Hi DGPickett

I have just come across the while read (file) option and it works beautifully!

Thanks everyone for your help. although I still dont' quite understand why the for loop and sed...
3,695
Posted By piynik
Here is the script #!/sw64/bin/zsh find...
Here is the script

#!/sw64/bin/zsh

find ./ -type d -maxdepth 1 -mindepth 1 > list_of_dir.txt

sed 's/^...//' <list_of_dir.txt >list_of_dir2.txt

rm list_of_dir.txt

echo list of data >...
3,695
Posted By piynik
nope...same thing happened :( sed: 1: "{1.....
nope...same thing happened :(

sed: 1: "{1.. 23}p": invalid command code .

but when I pasted the commands in the terminal it worked.
3,695
Posted By piynik
thanks vbe for your reply. I am using...
thanks vbe for your reply.

I am using zsh...

echo $shell

/sw64/bin/zsh
3,695
Posted By piynik
I think I am beginning to understand what the...
I think I am beginning to understand what the problem is. It seems the problem occurs with the sed command in the for loop. the error message sed: 1: "{1..23}p": invalid command code .
stems from...
3,695
Posted By piynik
Thanks for your reply. As I said I am...
Thanks for your reply. As I said I am inexperienced I am sure there are much better way to write this.

Can you explain why the code works if I paste it in the terminal but it doesn't if I run it...
3,695
Posted By piynik
the first line of code is how the script start
the first line of code is how the script start
3,695
Posted By piynik
My script doesn't work in the terminal window!
I am inexperienced with scripting and it continues to baffles me speechless

I wrote a script so that it counts the number of subset of files (with different prefix) in all subdirectories under the...
1,608
Posted By piynik
Ways to run script from anywhere
Hi I am trying to make my scripts to run from any directory and after some research (googling) I find there are 2 ways to do this

1. export PATH=$PATH:directory

2. create a /bin directory in...
5,019
Posted By piynik
echo $SHELL /sw64/bin/zsh
echo $SHELL

/sw64/bin/zsh
5,019
Posted By piynik
I am using zsh.....
I am using zsh.....
5,019
Posted By piynik
Arithmetric in while statement
I am running a loop that if $a is less than 1.5 OR $b is greater than 0.7 then do certain operation until $a is great than 1.5 AND $b is less than 0.7

at the moment $a=2.4 and $b=0.7

the script...
11,480
Posted By piynik
Thanks everyone!
Thanks everyone!
11,480
Posted By piynik
Arithmetic but keep 2 decimal places
I am trying to perform arithmetric, for example, to increment the value of variable $a (say 3) by 0.05 but when I tried the following expression

let a=a+0.05

or a=$((a+0.05))

both...
2,271
Posted By piynik
After much deliberation I can begin to make sense...
After much deliberation I can begin to make sense of the code

My final question is, as Awk reads in the first line of input and execute the following commands for the first line

...
2,271
Posted By piynik
the only way I could make sense of why that works...
the only way I could make sense of why that works is awk prints out whatever line that are between the two patterns, without much directionality.

/pattern2/ {on=0} on
when pattern2 is found,...
2,271
Posted By piynik
Why does that work? (what does it do?) and...
Why does that work? (what does it do?)

and why doesn't it work when you type it in one single line?
2,271
Posted By piynik
your code worked! many thanks for that. Perhaps I...
your code worked! many thanks for that. Perhaps I do not truly understand how the syntax awk '/pattern1/, /pattern2/' file works could you explain why adding the ^ character has made the difference?...
2,271
Posted By piynik
The table looks like this, I want to grab those...
The table looks like this, I want to grab those data and perform further awk operation (if column 6 greater than certain value then output column 2)



N Batch Mn(I) RMSdev I/rms ...
2,271
Posted By piynik
Hi RudiC and Corona, your command returns...
Hi RudiC and Corona,

your command returns nothing to screen.
Showing results 1 to 25 of 55

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