I need to process a file line-by-line using some value from a shell variable
Something like:
I can't make the '-s' work in the '-p' or '-n' input loop (or couldn't find a syntaxis.)
I have searched and found https://www.unix.com/302343759-post2.html, but it doesn't work
Is it possible (without havy sysntaxis, as ENV(..), for exmpl.) in the input loop?
What is the difference between defining the global variable through our and using use vars ?
Is the variable created using our goes beyond even package scope?
Thanks in Advance !!! (3 Replies)
Hi Folks,
The subject is my question:
Can we pass an array of strings from a Perl Program to a Shell Script?
Please provide some sample code.
Thanks
---------- Post updated at 11:52 PM ---------- Previous update was at 11:43 PM ----------
I got it.
Its here:... (0 Replies)
I have a perl script that opens a text file containing numbers on each line:
for example:
755993
755994
755995
755996
755997
755998
The perl script takes these numbers and store them as an array @raw_data, where I can access individual numbers by using $raw_data for the value 755993.... (2 Replies)
I am reading a file using While loop
while <FILE>
{
$_ = <FILE>;
process data...
}
I would like to quit reading the file once I encounter a String pattern. How do i do it.
is it
if (/SUMMARY/)
{
last;
}
I am having problems with uninitialized value in pattern... (1 Reply)
I have a shell script I want to run that will set environment variables based on the value of an input variable submitted when the shell script is called. For example:
$ mgenv.sh prod
This would set environment variables for prod
$ mgenv.sh test
This would set environment variables... (1 Reply)
I need shell 0r Perl script to read multiple input and do something and come out
example:
echo “ enter the host names separated by space “
read servers
foreach @servers
{ do
do something
done}
Here host names like host1 host2 host3 . . . . . . . so on
Please help me... (8 Replies)
My shell script generates a bunch of lines of text and passes this text as an argument to a perl script.
I'm able to do this, but for some reason newlines don't get recognized in the perl script and so the script just prints actual '\n' instead of carriage returning, otherwise everything gets... (3 Replies)
Hi,
I have a requirement as follows. Have 3 files. Need to match up the data in each one of them and sum up the data by a field and display it. example given below.
File 1 : Name, Emp id
File 2 : Empid, Subject,
File 3 : Subject, Score, Class
Match Emp id in File 1 and File 2 and then... (7 Replies)
I am trying to capture screenshots from a huge list of URLs. I am able to manually capture images of individual pages; that is, I simply run the following command to get a screenshot of Foo.com
$ python /path/to/screencapture.sh http://www.foo.com
I want to modify the script so that instead of... (2 Replies)
I am working on converting shell to Perl script. In shell we have built in function
trap
Do you know alternative in Perl or actually we don't need it?
Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies
LEARN ABOUT MOJAVE
platform::shell
platform::shell(n) Tcl Bundled Packages platform::shell(n)
__________________________________________________________________________________________________________________________________________________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(n)