Hi
I am trying to return more than one result from a ssh command.
[root@server ~]# cmd=`for i in 1 2 3; do find /root/dir$i -type f | wc -l; done`
[root@server ~]# echo $cmd
27 5 8
[root@server ~]# cmd=`ssh 192.168.0.1 "for i in 1 2 3; do find /root/dir$i -type f | wc -l; done"`...
Hi
I am writing a bash script in which i need to set variables in a for loop.
This doesn't seem to work and I'm not sure why it is any different to setting them any where else in the script.
I have tried:
array=(1 2 3 4 5 6 7 8 9); for i in ${array}; do "V$i"="test"; done
but i just get a...
Hi
Please could someone explaing the difference between a and b in the script below.
Not sure why the "a" test gives a false result.
echo 19G 19 | awk '{
alert= 5
a= substr($1,1,length($1)-1)
b= $2
if(a <= alert){
print "a: "a" is not less than "alert...
Hi
I am inserting windows newline charachers into a field with the intention that when i "select into outfile" the field data will be written on several newlines.
It seems problem is that the default behaviour is to escape
the backslashes when writing the outfile so i end up with the literal...
Hi
I am trying to create a random 2 digit number for each input record. The same number must also NOT be generated for at least 10 input records. This is what i have tried. I think I am close but I am not sure how to react to duplicates within the 10 record boundry. Probably also a more clever...
Hi
I'm trying to process a file with dates in the format of "week.year".
I need to convert this to "first day of week.month.year"
example:
01.2006 to 02.01.2006
02.2006 to 09.01.2006
03.2006 to 16.01.2006
I'm not sure if it's possible to pass the date command a string with the week in it.
Is...
Hi
I have a large file approx. 10 million records or 600mb.
I would like to remove dupicates based on the first 10
fields. I have a script which builds an array to match
against which works fine on smaller files but my pc falls
over if I try to do the same thing with large files.
Is there a...
hi
I am new to awk and am struggling with arrays. I am not sure how to print whole rows from matching columns or
perform an action on the results. For example from this data :
12a 3010 a 0919 10
12a 3510 a 0919 20
12a 3510 s 0919 40
12a 3520 a 0919 10
12a 3525 a 0919 20
12a 3525 s...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.