Search Results

Search: Posts Made By: asterisk-ix_use
1,344
Posted By asterisk-ix_use
Try creating an array instead of multiple...
Try creating an array instead of multiple variables like proc0,proc1..etc


val=0
for i in ${array
}
do
proc_output[$val]="$(ls -ld /proc/$i)"
((val++))
done
2,754
Posted By asterisk-ix_use
Please try searching the forum. Similar...
Please try searching the forum.
Similar question has been answered.
2,915
Posted By asterisk-ix_use
I think you should use indirect referencing. ...
I think you should use indirect referencing.

Not sure if this works..Try this..


i11="{1,2,3,4,5,6,7,8,9,10,11,}"
value=i11
eval echo \$$value
3,137
Posted By asterisk-ix_use
Just like shell, perl also uses the positional...
Just like shell, perl also uses the positional parameters $1,$2 etc. So, when you are using $9 in the awk command syntax, perl interprets $9 as one of the other variables in the perl script. Hence...
3,137
Posted By asterisk-ix_use
Use -1 switch of ls instead of awk ...
Use -1 switch of ls instead of awk


#!/usr/bin/perl -w
use strict;
my $count=0;
my @list=`ls -1`;
print "@list";
26,699
Posted By asterisk-ix_use
No need to declare variables in a shell script....
No need to declare variables in a shell script. The variables come to existence automatically when they are used. All the variables that do not exist are assumed to be null. So if you wish to give...
2,543
Posted By asterisk-ix_use
Few mistakes in your code: 1. Your 'for' loop...
Few mistakes in your code:
1. Your 'for' loop does nothing! Remove the ; after for statement
2. You are writing an assignment when u say Change it to comparision.
3. Use a print


awk -F,...
3,762
Posted By asterisk-ix_use
Use find command
To find the ".vws" files under all the directories in your home directory:


find . -name "*.vws"


And count of it:


find . -name "*.vws" | wc -l


If you want to find in...
2,687
Posted By asterisk-ix_use
user@linux-aah2:~/user/learn...
user@linux-aah2:~/user/learn (user@linux-aah2:~/user/learn)> cat data.txt
joe : 1 :a
bob : 2 :b
sue : 3 :c
foo : 4 :d


Script:


#!/bin/ksh
awk -F: -v len=$(wc -l < data.txt) '{
if (...
1,336
Posted By asterisk-ix_use
Thanks.
This made it so simple ;)
I was under the impression that the file should be an executable to source it.

I have learnt something new ;)
5,232
Posted By asterisk-ix_use
Same way!!
Execute this command in the TEST directory..


tar -cvf tarfile.tar *
3,318
Posted By asterisk-ix_use
Hey try these: For Q1: ...
Hey try these:

For Q1:




user1@linuxbox:/home/user1> cat data
<tr>
<td>word 1</td>
<td>word 2</td>
</tr>

user1@linuxbox:/home/user1> sed -n '/\/tr/{g;1!p;};h' data
...
4,833
Posted By asterisk-ix_use
Hi, Try this..!! This will help you when...
Hi,

Try this..!!
This will help you when you write all the commands which you created using a for loop to a file.

Assuming you modify your code as:


echo "\"<grep -w $file data\" ...
1,336
Posted By asterisk-ix_use
Thanks for the reply. As per my requirement,...
Thanks for the reply.

As per my requirement, the txt file cannot be executable. So I cannot source it. I have to just read it.:rolleyes:
Is there any other way that I could get the values of the...
1,336
Posted By asterisk-ix_use
Help with extracting a part of a line between two patterns
Hello All,

I have a text file with contents as below:

contents of error.txt:
message1="Reason for error code1"
message2="Reason for error code2"
message3="Reason for error code3.
...
Showing results 1 to 15 of 15

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