Linux for your taste (sorry Naw :D) (21 Viewers)

What OS do you use?

  • Windows

  • Linux

  • Mac

  • Other


Results are only viewable after voting.

Bjerknes

"Top Economist"
Mar 16, 2004
116,172
I think I'm getting a hang of it. We only need ten lines of code for this.

echo "Shell Script For Project 2" >> CaptureFile.txt

echo $shell
echo $path

#
## List all files into a variable file.
#

set files = `ls /home/meteo/atb5006/ProjectCombined/data*.f`

#
## For each is another loop.
#

@ count = 1
clear
foreach processfile ($files)
echo "Processing File $count == $processfile"
 

Buy on AliExpress.com

Martin

Senior Member
Dec 31, 2000
56,913
This is what I got so far... no clue what I'm doing.


echo "Shell Script For Project 2" >> CaptureFile.txt

echo $shell
echo $path

@ count = 1

while ($count <= 7)
echo "COUNT: $count"

if ($count < 7) then
echo $count > datafile.0$count.dat
else
echo "nothing to do"
endif

@ count ++
end

set files = `ls /home/meteo/jrz5001/ProjectCombined/data*.f`


@ count = 1
clear
foreach processfile ($files)
echo "Processing File $count == $processfile"

grep -n -e "$count" $processfile
@ count ++
end


set numarguments = $#argv

if ($numarguments >0) then
echo "Number of command line arguments: $numarguments"
@ iargs = 1
while ($iargs <= $numarguments)
echo "Argument $iargs == $argv[$iargs]"
@ iargs ++
end
endif

The commented out part seems redundant to me since the while loop has a termination condition. Unless there is some reason you badly want to execute once after you've done all the iterations you want to do, only to output "nothing to do".

Code:
while ($count < 7)
   echo "COUNT: $count"

#     if ($count < 7) then
        echo $count > datafile.0$count.dat
#     else
#        echo "nothing to do"
#     endif

   @ count ++
end
The rest looks fine, but it's not clear to me what the purpose is, all it does is produce some output.
 

Bjerknes

"Top Economist"
Mar 16, 2004
116,172
Disregard that, Martin. That was way too much code needed.

This is practically all I need, but I have to switch up a few things probably.

Code:
echo "Shell Script For Project 2" >> CaptureFile.txt

echo $shell
echo $path

#
## List all files into a variable file.
#

set files =  `ls /home/meteo/atb5006/ProjectCombined/data*.f`

#
## For each loop.
#

@ count = 1
clear
foreach processfile ($files)
   echo "Processing File == $processfile"

   grep -n -e "$count" $processfile
   @ count ++
end
 

Bjerknes

"Top Economist"
Mar 16, 2004
116,172
Hey Martin, I think it's good but the terminal says ls: no match. Everything seems to be order.

Code:
#!/bin/csh

#=============================================================================#
# A shell script used to process seven files.
#=============================================================================#
# Authors: Andrew Beck
#          Joe Zimmerman
#          Rob Aramondo
#          Greg Oddo
#         
# Emails: [email protected]
#         [email protected]
#
# Date:    12/10/08
# Version: 1.0.0
# Executing:
#     csh shell.csh
#=============================================================================#

echo "Shell Script For Project 2" >> CaptureFile.txt

echo $shell
echo $path

#
## List all files into a variable file.
#

cd /home/meteo/atb5006/meteo473/project

set files = `ls wrfout*00` 

#
## For each is another loop.
#

@ count = 1
foreach processfile ($files)
   echo "Processing File $count == $processfile"
   ./AndyProject1 $processfile 
   @ count ++
end

#=============================================================================#
# End of scripting program
#=============================================================================#
 

Bozi

The Bozman
Administrator
Oct 18, 2005
22,749
guys i need some help- got my missus an i-pod for x-mas and tried all fuckin day to put music on it using hipo ipod management tool. the ipod has 3.6GB used, using the management too, it says there is 360+ songs on it but when disconnected the i-pod does not seem to have any songs...anywhere, yet there is still over 3Gb of space used.

add to this that certain music files just will not transfer and you will understand i am tearing my hair out
 

Martin

Senior Member
Dec 31, 2000
56,913
Martin, last night at the airport I convinced a Bulgharian to switch :D
Nice work ;)

Martin, the xtorg icon set is not working on KDE 4, any idea on how to make it function?
I spent hours trying to diagnose this bug and eventually gave up. It's been reported and frankly I can't be bothered to put in any more time into it. If they don't do something about it I'll have to release a kde4 specific version of xtorg to work around it.
 

Martin

Senior Member
Dec 31, 2000
56,913
guys i need some help- got my missus an i-pod for x-mas and tried all fuckin day to put music on it using hipo ipod management tool. the ipod has 3.6GB used, using the management too, it says there is 360+ songs on it but when disconnected the i-pod does not seem to have any songs...anywhere, yet there is still over 3Gb of space used.

add to this that certain music files just will not transfer and you will understand i am tearing my hair out
no ipod in this house, I guess you'll have to track down some users of the app you're using to transfer files and they probably have heard of it
 

Users Who Are Viewing This Thread (Users: 0, Guests: 15)