10-29-2011
What are different ways of executing shell commands?
I am a student in BCIT in vancouver and taking comp2771 course.(Shell scripting).
I would like to know what are different ways of executing shell commands?
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have to execute some commands after executing one command ( cleartool setview Tagname)
Problem is that I write commands in script like this.
echo "test1"
cleartool setview tagname
echo "test2"
copy file1 file2
echo "test3"
but when I execute script.
Output
---------
test1
If I... (1 Reply)
Discussion started by: udaykishore
1 Replies
2. Shell Programming and Scripting
Hey there,
I am trying to pass a command as argument to a function.
The command shows up in $1.
Now I want to execute this command, but if I do a $1
./sample
"bla/blaprintf: warning: ignoring excess arguments, starting with `bla/bla'
The code is :
#!/bin/ksh
fn()
{
$1
}
fn... (3 Replies)
Discussion started by: shriyer
3 Replies
3. Shell Programming and Scripting
Hi,
I want to run these two commands one after the other.
awk 'BEGIN {OFS="\t"} {print $2}'
sort -u
rather than typing awk 'BEGIN {OFS="\t"} {print $2}' file1 > file2, then sort -u file2 > file3. Is it possible to run both commands on file1 then get output file3?
Its kinda hard for... (5 Replies)
Discussion started by: kylle345
5 Replies
4. UNIX for Dummies Questions & Answers
We have two processes, one which copies a control file into a folder and another which is polling this folder and reading the control files.
Sometimes they clash and the reader fails because the copy is still happening.
We have been told that we should change the copy to a move because the... (1 Reply)
Discussion started by: sbarnes
1 Replies
5. Shell Programming and Scripting
I need to execute a command to run my script several times with varying parameters
perl ex.pl -b 130198 -e 130884 -c plot plot.txt 1_plot.txt
perl ex.pl -b 1345 -e 1308 -c plot plot.txt 2_plot.txt
perl ex.pl -b 1345567 -e 130898 -c plot plot.txt 3_plot.txt
.
.
.
100's of excutions
... (2 Replies)
Discussion started by: Lucky Ali
2 Replies
6. UNIX for Dummies Questions & Answers
the ssh calling convention:
ssh <server>
If I put commands in the section, ssh will execute them immediately after logging in and return to local shell. I want to stay in the remote shell after executing these commands. How can I achieve this?
Thanks for all. (1 Reply)
Discussion started by: hplonlien
1 Replies
7. Shell Programming and Scripting
Hi All,
I am trying to execute a shell script containg awk commands. But unable to do so. Below is my script. Please help.
The name of the script is scan.sh and I have tried executing it using the command sh scan.sh
It is giving an error which reads like:
awk:syntax error near line 7... (3 Replies)
Discussion started by: misb
3 Replies
8. Shell Programming and Scripting
Hello
In the shell script we have a FTP command like below
ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT
quote USER $FTP_USER
quote PASS $FTP_PASS
ascii
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE
bye
exit
If i... (1 Reply)
Discussion started by: Pratik4891
1 Replies
9. Shell Programming and Scripting
I am trying to execute a piped combination of shell commands inside a perl program.
However, it is not working as desired.
This is my program, i am trying to print only filenames from the output of ls -l
$ cat list_test
#!/usr/bin/perl -w
use strict;
my $count=0;
my @list=`ls -l|awk... (4 Replies)
Discussion started by: sam05121988
4 Replies
10. Shell Programming and Scripting
I would like to execute a commands in four different servers through ssh at a single instance(simultaneously).
Below are the details with examples,
ssh user1@server1 "grep xxxx logs"
ssh user1@server2 "grep xxxx logs"
ssh user1@server3 "grep xxxx logs"
Each statement will take some... (4 Replies)
Discussion started by: Amutha
4 Replies
LEARN ABOUT SUSE
openipmish
openipmish(1) Shell interface to an IPMI system openipmish(1)
NAME
openipmish - Shell interface to an IPMI system
SYNOPSIS
openipmish [option]
DESCRIPTION
The openipmish is a command interpreter that gives the full power of the OpenIPMI library to a user-level command language. It is designed
so it can easily be driven with a scripting language like TCL, it has well-formed output.
openipmish starts up with no connections or anything of that nature. You must enter commands to make connections to domains.
OPTIONS
--dmsg Turn on message debugging, this will dump all messages to debug log output.
--drawmsg
Turn on raw message debugging, this will dump all low-level messages to debug log output. This differes from normal message debug-
ging in that all protocol messages are also dumped, not just IPMI messages.
--dmem Turn on memory debugging, this will cause memory allocation and deallocations to be checked. When the program terminates, it will
dump all memory that was not properly freed (leaked).
--dlock
Turn on lock debugging, this will check lock operations to make sure that locks are help in all the proper places and make sure that
locks are properly nested.
--snmp Enable the SNMP trap handler. openipmish must be compiled with SNMP code enabled for this option to be available.
--help Help output
COMMANDS
openipmish follows the standard command syntax defined in ipmi_cmdlang(7). See that for the details on most commands. The IPMI manual
that comes with OpenIPMI will also be quite handy.
openipmish defines some commands that are not in the standard command language. These are:
read Read and execute commands from the given file.
exit Quit
redisp_cmd on|off
Normally, openipmish redisplays the command line when an event comes in. This is nice for interactive use, but bad for scripting.
This lets you turn that function on and off.
SEE ALSO
ipmi_cmdlang(7), ipmi_ui(1)
KNOWN PROBLEMS
None
AUTHOR
Corey Minyard <cminyard@mvista.org>
OpenIPMI 05/13/03 openipmish(1)