Simple while-loop problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Simple while-loop problem
# 15  
Old 07-23-2010
Quote:
Originally Posted by radoulov
Yes,
you need to post the exact content of the script (including the modified versions you're testing), the exact command you're executing and all the output/error messages that you're getting (copy/paste, please, don't try to re-write).

Enabling xtrace/verbose output would be beneficial also, hint: add this line to your script, after the first line:

Code:
set -xv

i would LOVE to copy and paste everything but the set-up of computers means that only this one has the internet, whilst the one with unix doesn't!!! But I assure you I check everything 3 times now after missing teh !#/bin/bash thing! and its all there! and the error messages are pretty much as I type, nothing more, nothing less..

---------- Post updated at 12:06 PM ---------- Previous update was at 11:59 AM ----------

On a slightly different note, how would I get the unix OS on my laptop at home without having to install it? like with the virtual box thing? Do you guys reccomend anything?
# 16  
Old 07-23-2010
ok so when i do the ps command, i get:

Code:
  PID TTY         TIME CMD
 14876 pts/63       0:03 tcsh
 14864 pts/63       0:03 tcsh

# 17  
Old 07-23-2010
Yep it would really help to know your environment and the vintage of your Solaris:

What is the output from the following enquiry commands.

Code:
echo $SHELL

which sh
which ksh
which bash

uname -a



---------- Post updated at 12:34 ---------- Previous update was at 12:30 ----------

Just seen your last post.

Very surprised to see "tcsh". That is just about the least useable Shell there is.
Any way you can get your Systems Administrator to make a Posix shell available to your account?

---------- Post updated at 12:37 ---------- Previous update was at 12:34 ----------

On the other subject, please start a new thread making it absolutely clear what make model and specification of laptop you have, any existing Operating Systems and how much free disc space you have.
# 18  
Old 07-23-2010
---------- Post updated at 12:37 ---------- Previous update was at 12:34 ----------

On the other subject, please start a new thread making it absolutely clear what make model and specification of laptop you have, any existing Operating Systems and how much free disc space you have.[/QUOTE]


Sure, i'll do it when i get home!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple loop using for

Dear experts, I am writing a bash script. At some point of the program I need to have 'for' loop. For simplicity I tried with some other simple code. The format of the loop is given below. k=51 m=55 for j in {$k..$m};do w=$(($j+2)) z=$(($j+9)) echo "$w, $z" done But my... (4 Replies)
Discussion started by: vjramana
4 Replies

2. Shell Programming and Scripting

a simple loop

Does any body can help me with a loop in this example? if then if then runner=$(grep "$1" "$2") runne=$(grep "$1" "$3") run=$(grep "$1" "$4") fi fi # # Message on screen... (3 Replies)
Discussion started by: bartsimpsong
3 Replies

3. UNIX for Dummies Questions & Answers

simple script with while loop getting problem

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)
Discussion started by: rajkumar_g
2 Replies

4. UNIX for Dummies Questions & Answers

Simple loop

I need to chmod a bunch of files with a specific extension in one directory. If I understand correctly first I would run ls command like this ls -R | grep .mp3 > /tmp/list once I have the output file I should be able to run a loop to chmod all the files in the list created. This is where... (5 Replies)
Discussion started by: eugenes18t
5 Replies

5. Shell Programming and Scripting

Simple using For loop

Hi expert, I'm using csh Code: #!/bin/csh set x = 0 set number = `awk '{array=$0} END {print array;}'` i want to use for loop to store data to $number repeatly untill x = 23 How to use c shell for loop? (2 Replies)
Discussion started by: vincyoxy
2 Replies

6. Shell Programming and Scripting

A simple (?) loop

I have what I believe is a simple programming question. I have a text file that looks like: mol 1 G:\stereo01.hin block text ... ... ... endmol 1 However, I would like a file that repeats this entire block of text several times over. The lines of text in the middle remain the same for each... (2 Replies)
Discussion started by: red baron
2 Replies

7. Shell Programming and Scripting

simple while loop

i have a script called file2 #!/bin/ksh i=0 while do echo $i >> result.txt i=`expr $i + 1` done echo "***********************" >> result ------------------------------------------------------------------- (10 Replies)
Discussion started by: ali560045
10 Replies

8. Shell Programming and Scripting

simple for loop

i have the following process running in background: when i give "ps -lef" ------------------------------------------------------------------------ user2 user1 user1 user3 user1 user4 user5 user4 user3 user4 user2 user1 user1 user3 user1 user4 (3 Replies)
Discussion started by: ali560045
3 Replies

9. Shell Programming and Scripting

Simple bash for loop problem

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)
Discussion started by: kingdbag
4 Replies

10. Shell Programming and Scripting

a simple while loop

Hallo everyone I might just be being dumb, but I am using the BASH shell and cannot get the following script to work: x=0 while do echo $x x=´echo "$x + 1" | bc´ done Can anybody help me out. I am just get a repeating output saying: bc: command not found 0 + 1: command not... (5 Replies)
Discussion started by: syno
5 Replies
Login or Register to Ask a Question