12-13-2012
Without knowing what you want to do, it's difficult to say how you should write your for-loop.
You can use $# to tell how many arguments are left, and shift to delete the first argument, so you can make a loop while $# is greater than zero and check the value of $1 every loop to determine what to do.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
In a shell script, how can I do the following:
Find out the size of a mounted usb stick (df -h /media/usbdisk) and use the
result (physical size of USB stick) to set a loop-counter according to the disk size??
As a result, I do copy files of 4MB each as many times as they will fit... (1 Reply)
Discussion started by: joerg535
1 Replies
2. Shell Programming and Scripting
hello unix-people.
can u please tell me how i can get the current bandwidth usage of my machine on shell into variables?
thanks a lot (2 Replies)
Discussion started by: scarfake
2 Replies
3. Shell Programming and Scripting
i have a small problem getting a batxh shell script to run in shell
this is the code
the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command
this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Discussion started by: wingchun22
1 Replies
4. Shell Programming and Scripting
Hi All,
How could I use telnet to connect to Primary Host in the below shell script:
Could I use:
(
echo user
sleep 2
echo password
sleep 2
echo "ls ~"
sleep 2
echo "exit"
) | telnet hostname
... (1 Reply)
Discussion started by: a1_win
1 Replies
5. Shell Programming and Scripting
I'm trying to count and display the variables on a command line
#!/bin/ksh
$# argv
from command line: tryit2 this is a test
returns : tryit2: 4: not found. (1 Reply)
Discussion started by: Bperl1967
1 Replies
6. Shell Programming and Scripting
I need help on how to connect remote systems through ssh command in while loop of shell script. I was able to connect one remote system using ssh from shell script. Please find sample code snippet as given below…..
ssh "root@148.147.179.100" ARG1=$rpmFileName 'bash -s' <<'ENDSSH'
... (5 Replies)
Discussion started by: rajesh.tulluri
5 Replies
7. Shell Programming and Scripting
Suppose im in a directory A. which has sub-directories x/y/z m/n/p etc. Iam only considered with those which have a file netl.oa at the lowermost level. So i used the find command which gives me a list in the form
./abc/def/ghi/jkl/netl.oa
and so on
Now i want the names abc def jkl and ghi. My... (3 Replies)
Discussion started by: sid.verycool
3 Replies
8. Shell Programming and Scripting
Hi All,
I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide
which cpu number (column 2) has maximum value (column 6).
Since the output is displayed/updated every seconds, it's very... (1 Reply)
Discussion started by: Optimus81
1 Replies
9. UNIX for Dummies Questions & Answers
Hi,
A basic sed question.
I have a set of files. In each file there is a number that I want replaced. For example, if I run sed I should get the following:
% cat test2.txt
#goofy//171.00
goofy 171.00
% sed -i 's/171/xxx/g' test2.txt
% cat test2.txt
#goofy//xxx.00
goofy xxx.00
... (2 Replies)
Discussion started by: pc2001
2 Replies
10. Shell Programming and Scripting
I'm a newbie to shell scripting, I was given this script to modify. This script that monitors when CPU Usage is too high based off the top command. The comparison is not working as it should. Its comparing a decimal to a regualar interger. When it send me an email, it send an email and ignores the... (21 Replies)
Discussion started by: mhannor
21 Replies
LEARN ABOUT DEBIAN
platform::shell
platform::shell(3tcl) Tcl Bundled Packages platform::shell(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
platform::shell - System identification support code and utilities
SYNOPSIS
package require platform::shell ?1.1.4?
platform::shell::generic shell
platform::shell::identify shell
platform::shell::platform shell
_________________________________________________________________
DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell.
This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only
requirement is that the other shell (identified by its path), is actually executable on the current machine.
While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell
this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run
32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers.
For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed
packages, versus the architecture of the shell running the repository software.
COMMANDS
platform::shell::identify shell
This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell.
platform::shell::generic shell
This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell.
platform::shell::platform shell
This command returns the contents of tcl_platform(platform) for the specified Tcl shell.
KEYWORDS
operating system, cpu architecture, platform, architecture
platform::shell 1.1.4 platform::shell(3tcl)