Sponsored Content
Full Discussion: Two curious questions
Top Forums Shell Programming and Scripting Two curious questions Post 302709547 by jamie_123 on Wednesday 3rd of October 2012 10:52:32 AM
Old 10-03-2012
Two curious questions

Hi,

I have been thinking about a few things that I have no idea of how to do with a scripting language (awk/sed I know to make proper use of just these 2).

1. Is there a way to have persistent variables? Say a variable that will be held in memory, and which can be accessed by subsequent scripts, without having to write it to a file and re use it later.

2. Is there a way to retrieve results of a command before a pipe, say for example
Code:
cat filex | awk '{print $2}' | awk '{sum+=$1}END{print sum}'

is there a way that I can get to see the $2 values without writing to a file?

Probably both of these questions can be answered by using different scripts that do more than one function, I just wanted to know if there is a in-built/ default way of doing this.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Just curious, does Unix stand for anything?

If not, where did the name come from? (6 Replies)
Discussion started by: pudad
6 Replies

2. UNIX for Dummies Questions & Answers

Curious

Dear All I am curious to know, that in a system compromise, when someone has access to a box, does that individual have access to a shell on the system, i.e. the person is logging into the system using telnet or SSH to remotely access the box?? How does this individual/ hacker access the system. ... (2 Replies)
Discussion started by: skotapal
2 Replies

3. UNIX for Dummies Questions & Answers

Curious Dummy

I have a website but I do not for the life of me know how to upload using unix based command lines. Can someone send me a good site that has these commands. That and I am curious to know more about command line based interfacing. :D Curious Dummy (1 Reply)
Discussion started by: highway39
1 Replies

4. Linux

Curious?

To correct most of the problems with this language, How do I remove the DOS and WORD stuff from it? These come from the fact that it was written on those with a Microsoft supplied platform at the writers request. (1 Reply)
Discussion started by: River Freight
1 Replies

5. UNIX for Advanced & Expert Users

Curious 'ls' Issue

Hi, I am seeing a curious issue with 'ls' command. If I open a telnet session of my Solaris box and give "ls". The output is in 3 columns. a b c d e f g h i j k l However, if I give the same command after a couple of hours in the same window, it goes to 6 columns according to the... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies

6. Shell Programming and Scripting

curious

sorry, just simple question: how can i do this in bash> foreach i( 1 2 3 ) sed 's/Hello/Howdy/g' test$i > test$i.new mv test$i.new test$i end (6 Replies)
Discussion started by: kurosaki
6 Replies

7. Solaris

Curious MPxIO problem

Hello folks, I have a newly installed Solaris 10 system running on a T6320 blade. I have set up LDM with the intent to move an ldom from another blade to this one. So far, so good. I had the SAN folks make the LUNs belonging to the ldom visible to my new blade and I can see them, all 4 paths.... (4 Replies)
Discussion started by: Ranck
4 Replies

8. UNIX for Dummies Questions & Answers

Curious about the -9

I was talking to a coworker and we got into a discussion about the -9. No one knew where the -9 came from and it's not in the man. I suggested that it was like counting to 10 (0-9) and you finally get to the point that that's it, the durned thing is going to die. So how did the -9 come to mean... (3 Replies)
Discussion started by: pflickner
3 Replies

9. Shell Programming and Scripting

Curious

I dont get something about sed If i have a text file inside contain a:a:a:a:a sed "s/"$title:$author:$price:$qtyAvailable:$qtySold"/"$Ntitle:$author:$price:$qtyAvailable:$qtySold"/" This work!! but If i have a text file inside contain Tom Tom:La La:Di Di :Do Do :De DE It cannot work... (2 Replies)
Discussion started by: GQiang
2 Replies
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)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy