Search Results

Search: Posts Made By: amrutha0303
19,461
Posted By amrutha0303
NeutronScott, The outcome for post 6(code...
NeutronScott,

The outcome for post 6(code by you) is the same as the one i posted. I get the same problem when i run your code as well. The first 8 entries of the array are somehow concatenated...
19,461
Posted By amrutha0303
Corona, I dont get what you mean. I have...
Corona,

I dont get what you mean. I have run the latest script i posted just above your post. I was able to assign the file names to the array. I am not sure how to look at the values stored in...
93,835
Posted By amrutha0303
Thanks Nuetronscott. It works well.
Thanks Nuetronscott. It works well.
19,461
Posted By amrutha0303
Corona, I reran the scripts using bash...
Corona,

I reran the scripts using bash shell and they were throwing the same errors at me.

I am still looking for some help trying to print the values stored in the array for the code below:
...
93,835
Posted By amrutha0303
Corona, It is a chmod warning, it cant...
Corona,

It is a chmod warning, it cant access ./test .
The location for the bash is /usr/bin/bash.
I replaced /bin/bash with /usr/bin/bash and i ran the chmod u+x ./test but same warning pops...
93,835
Posted By amrutha0303
Corona, Thanks for the reply. It solves my...
Corona,

Thanks for the reply. It solves my problem.

I appreciate all you guy's help with this.

-A
93,835
Posted By amrutha0303
I tried to run it the same way.. just named my...
I tried to run it the same way.. just named my file test.sh instead of s and ran it as
sh test.sh

And thats the error i recieved.

Is there something wrong with the way i am running my...
93,835
Posted By amrutha0303
NeutronScott, Yes i am trying sh...
NeutronScott,

Yes i am trying sh script_name.sh!

Is there a different way to run it?

-A
19,461
Posted By amrutha0303
Chubler, i tried to remove the space...
Chubler,

i tried to remove the space between the = and still i had the same problem. Yes, the code line you gave is the same as the one i used in my script. Your code gave me an idea to use it. ...
93,835
Posted By amrutha0303
I tried to run a script: #!/bin/bash ...
I tried to run a script:

#!/bin/bash
num=0
i=0
for i in {1..10}
do
(( num += 1 ))
echo $num
done


I get an error: num not found and the value of num is not incremented.

Could you...
93,835
Posted By amrutha0303
Radulov, Can you suggest how i could...
Radulov,

Can you suggest how i could incorporate (( c += 1 )) in my bash shell script and echo the value of $c?

-A
93,835
Posted By amrutha0303
Radulov, actually, its not throwing an...
Radulov,

actually, its not throwing an error at the command you just listed. So it is bash.

-A
19,461
Posted By amrutha0303
Neuron, The problem with your code on my...
Neuron,

The problem with your code on my machine is that it would throw errors like `(' unexpected syntax errors when i try something like you said.

That is reason why i had to take the...
93,835
Posted By amrutha0303
Radulov, Here is the output to your...
Radulov,

Here is the output to your commands:
ps -p$$

PID TTY TIME CMD
1198 pts/4 0:01 bash

echo $BASH_VERSION


3.2.51(1)-release


It is bash shell for sure!!:):)
93,835
Posted By amrutha0303
Hello there, Thanks both for the quick...
Hello there,

Thanks both for the quick reply. I tried using (( C +=1 )) and it kept throwing a syntax error at me. I was just not sure why.

I am curious though. Functions like $(( ls - l )) ...
19,461
Posted By amrutha0303
NeutronScott, Thanks for the reply. I...
NeutronScott,

Thanks for the reply. I realized ls was not a good command to go with. I replaced it. It works great. I figured how to increment as well. The problem now is i am not sure how to...
19,461
Posted By amrutha0303
Chubler, Thanks for the reply. I could...
Chubler,

Thanks for the reply. I could populate it by directly assigning the output of the ls -l to a variable but, the output of the ls symbol will be loaded into the 0 th position of the...
93,835
Posted By amrutha0303
Increment a variable in unix bash
Hello There,

I have been trying to increment the value of variable to 1, 2, 3 etc. but, it displays
1
1+1
1+1+1
.....
:wall:
Could anyone help out with this?

for i in *.*
do
s=`expr...
19,461
Posted By amrutha0303
Write filenames into an array variable
Hello there,

I am a newbie to unix and i have been trying to code a shell script for bash shell which reads the files in a folder using ls and writes them into an array variable. But, i am...
Showing results 1 to 19 of 19

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