I've been having trouble completing a script (bash) because I can't get past the issue of finding a line in a file. For example, I have a file like this:
I'm making a loop, and I need a way to call a line number without specifying what the line contains (i.e., grep doesn't work). Here's what I had in mind:
n=2
While (something that makes the loop infinite); do
day=`command line${n} word1
Someone posted another reply, but it got deleted because I double-posted (notice the post is cut-off after "if." I can't remember what happened but I guess I ended up starting over and posted twice accidentally).
Here's jim mcnamara's reply to the deleted post, which got sent to my email:
output:
Code:
---------
set time 24may2003
draw mark -100.0 24.1
set time 25may2003
draw mark -100.1 24.0
set time 28may2003
draw mark -99.5 23.2
set time 05jun2003
draw mark -97.0 22.7
---------
source file = "filename" above:
Hi guys !
I generated the power set of the set S={a,b,c} using crunch:
crunch 1 3 abc
and get the 39 possible subsets:
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
… (2 Replies)
Hi ,
On my box everything works fine. But whenever I run command
It returns nothing as you see @(none) too.
Its very strange issue I have never noticed on any other system yet.
Any one have any idea about this.
Thank you (2 Replies)
Hello guys,
Is there any command to check the all child processes of a process like `ptree`?
ptree is not working in Linux..
Regards,
Raghu (3 Replies)
Hi ,
I just wondering if there is any command that works similar to the expect command. I'm trying to setup a korn shell script that goes to remote servers and executes a command likes :
su - username -c "script to execute "
but then it'll prompt for the password so if I can provide... (1 Reply)
hi, I m stuck at a point for more than 3days. My doubt is pretty simple..
I have a web page content in $content. ( got this by using LWP)..
Now I want to display the content matching a pattern.
I tried
if($content =~ m{<div class="abc">(.*?)</div>}s){
print $1;}
that will... (4 Replies)
Hi all,
I am trying to create a file that shows the CPU usage, constantly updating (similar to TOP).
So far i have a file (called test) containing:
echo "The current CPU usage is:" `ps -e -o pcpu|awk 'NR > 0 { s +=$1 }; END {print s"%"}'`
and then I ran the command:
watch -d 0.5 -t... (3 Replies)
Hello all,
I need a help in unix. is there any command in unix similar to doskey in MS Dos. It taked pain to enter the big command again and again.. the up and down arrows do not bring the previous commands on the prompt. so pls let me know if there is any command to enable the doskey kind of... (4 Replies)