If you are not worried about the order of the printing of 1st field then following may help you in same.
Please let me know how it goes then.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Hey all. Thanks in advance for any help you can give, hopefully this is an easy one. I want to create a loop to run a simple performance monitor like vmstat and record it to a file, but have very limited scripting skills (obviously).
Starting with this...
date >> /var/log/perfmon.log
vmstat... (2 Replies)
I'm just trying to make a script that runs in command line to echo each line in a text file. Everything i found on google is telling me to do it like this but when I run it it just echos removethese.txt and thats it. Anyone know what im doing wrong?
for i in removethese.txt; do echo $i; done
... (4 Replies)
Hi,
I want to do a simple loop where I have one column of text in a file and I want the loop to read each line of the file and do a simple command.
The text file will be something like this:
hostname1
hostname2
hostname3
hostname4
I am using Bash and have already come up with this to... (1 Reply)
I am trying to create a simple ksh loop script. What I've pasted below is not working. Any help is appreciated.
typeset -i count
typeset -i tcount
count=0
tcount=0
while $tcount >= 11
do
print "\$count is $count"
pwd
ls -l
sleep 30
$(( $tcount = $count + 1 ))
... (5 Replies)
Hello forum memebers.
can you correct the simple while program.
#! /bin/ksh
count=10
while
do
echo $count
count='expr$count-1'
done
I think it will print 10 to 1 numbers but it running for indefinite times. (2 Replies)
Hi to everyone here,
I'm a new user and relatively-new linuxer.
I'm trying to write a script that checks if every file from a directory is present in a given list and if not, delete it.
should be simple. But I think I've done half the work only:
this is to create the reference list:
for c... (2 Replies)
Hi! I am just starting to learn scripting.
I am trying a simple script in bash and zsh
I have two questions:
First: Why zsh does not expand the var M? What I am doing wrong?
localhost galanom # bash -c 'M="m1 m2 m3 m4 m5"; for x in $M; do echo "<$x>"; done'
<m1>
<m2>
<m3>
<m4>
<m5>... (1 Reply)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
Hi,
I am completely new to shell scripting. Basically I am wanting to create a simple while loop script to check if a network connection is available from 'netstat -a' and if its present then output a character to the serial port. I think i am nearly there.. but need some assistance.. this is... (9 Replies)
Hi all,
Please guide me writing this script
Follwing is the file which I have created, which contains the files to be copied.
cat system1-dr.txt
/etc/passwd
/etc/shadow
/etc/group
/etc/vfstab
/etc/profile
/etc/default/init
/etc/shells
/etc/dfs/dfstab
/etc/dfs/sharetab... (11 Replies)