Sponsored Content
Top Forums Shell Programming and Scripting Changing shell from a script and running something from the new shell Post 302923139 by Corona688 on Thursday 30th of October 2014 04:21:06 PM
Old 10-30-2014
That trick only works if the script is read from standard input.

Code:
sh -s <<EOF
echo "stuff"
# Some other command which reads the following lines
ssh user@host
echo \$HOSTNAME
EOF

This is because the command could not otherwise know what file to read from.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Password changing in a Script (shell and expect)

Hi, Does anybody know how to change the password on multiple servers with a script. I have 300 Sun boxes and the password expiry is set to 30 days. Im in a process to build a script using expect. Need a help from an expert who has already done it. Regards, Vinod (1 Reply)
Discussion started by: chellam
1 Replies

2. Shell Programming and Scripting

Changing cursor position using shell script

Hi, Pleae help me on this. Normally, when we say read username, the cursor will come in the first position of next line, but I want the output of the below Normal usage ------------- please enter username: _ I want like the below ---------------------- please enter username: ... (2 Replies)
Discussion started by: balamv
2 Replies

3. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

4. Shell Programming and Scripting

Changing value of a variable inside a shell script

I have a continous polling happening inside a shell script on AIX. This actually calls a PL/SQL block. Is there a way I can set up a variable or pass an interrupt to end the script gracefully. I cant read from the config once the job starts running. Ideally I should change value of a variable and... (1 Reply)
Discussion started by: kshyju
1 Replies

5. Shell Programming and Scripting

Regarding changing shell thru script

Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine. Or please suggest other alternative if any??? #!/bin/ksh HOST=`hostname` echo "Running the script..." for MyServer in `cat ServerNames.txt` do echo "\n Logging onto... (4 Replies)
Discussion started by: sdosanjh
4 Replies

6. UNIX for Dummies Questions & Answers

Changing permissions in a shell script

Hi All, I have a shell script which we keep on changing permissions on a On-Demand Basis-->for e:g--from 400(Read only) to 740(Execute permission) etc. Is there any way by which I can view the history of the script?-->I am interested in finding out the date-time stamps when the script's... (2 Replies)
Discussion started by: DevotedPupil
2 Replies

7. Shell Programming and Scripting

Shell script running command in different shell

Hi All, Is there any way where we can run few commands with different shell in a shell script ? Let's have an example below, My first line in script reads below, #!/bin/sh However due to some limitation of "/bin/sh" shell I wanted to use "/bin/bash" while executing few... (9 Replies)
Discussion started by: gr8_usk
9 Replies

8. Shell Programming and Scripting

Help with shell script on Month Changing Logic

Hi Unix Experts, Happy Morning to all !! :) I am new to UNIX Shell Scripting and at my begineer level. To get acquainted to scripting, I am trying to create a script. The details/requirements of my script was to create a script with month changing logic in it so that on every 6th Working... (3 Replies)
Discussion started by: micky3112
3 Replies

9. Shell Programming and Scripting

Running 3 shell script parallel in another shell script

Hi, I'm trying to do teh below thing. I have a single script which uses 3 different parameters to do 3 different work like belwo. test1.sh par1 -- it shuts down an instance test1.sh par2 -- it shuts down an instance test1.sh par3 -- it shuts down an instance Now I created a script... (7 Replies)
Discussion started by: bhaski2012
7 Replies

10. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 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 05:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy