Sponsored Content
Top Forums Shell Programming and Scripting Issue with running multiple commands withing su command Post 302894210 by John K on Monday 24th of March 2014 11:02:43 AM
Old 03-24-2014
Hi vbe,
As you can see above, OP used just single quotes to enclose multiple commands. So double quotes are not actually needed when you have multiple commands. Right ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

running a simple script file with multiple commands

I'm trying to run a script file with multiple commands that I would normally type into the command line. The commands are: #!/bin/bash diff Test1.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1.o0 > differences2 diff Test1a.o0 /usr3/ronelso4/Desktop/verificationKPC/Test1a.o0 >> differences2... (1 Reply)
Discussion started by: knelson
1 Replies

2. Shell Programming and Scripting

Running multiple unix commands in a single script

Hi, I would like to write a script with include more than 6 unix commands. my script like below: echo " script started" ls -ld bdf | grep "rama" tail -10 log.txt ... .. ... now, i want to run above unix commands one by one. example: first the ls -ld command will be... (3 Replies)
Discussion started by: koti_rama
3 Replies

3. Shell Programming and Scripting

awk splits file in to multiple - how to get filenames in variables withing ksh?

Hi all, I'm using awk in a .ksh script to split one file by line prefix into different files (up to 4). The files are named after the prefix in the line, and a sequence no. Is there any way to get the filenames in to variables too? I need _ftpfile1, _ftpfile2, _ftpfile3 and _ftpfile4 which are... (2 Replies)
Discussion started by: spidermike
2 Replies

4. UNIX and Linux Applications

Running oracle commands Directly from Command Line

In mysql, I can get what I want from a database without having to log into mysql. works great for me and it is perfect. now, i want to be able to do the same in oracle but I dont know how to. For example, if i want to retrieve information from the mysql database from the command line, i issue... (4 Replies)
Discussion started by: SkySmart
4 Replies

5. Programming

Running Multiple Unix commands in qx

Hi All, Is there anything wrong with below syntax? qx {perldoc -v ModuleName.pm | grep -i Description } BTW, this question is related to Perl. Thanks. (3 Replies)
Discussion started by: jal_capri
3 Replies

6. Shell Programming and Scripting

Running multiple commands stored as a semi-colon separated string

Hi, Is there a way in Korn Shell that I can run multiple commands stored as a semi-colon separated string, e.g., # vs="echo a; echo b;" # $vs a; echo b; I want to be able to store commands in a variable, then run all of it once and pipe the whole output to another program without using... (2 Replies)
Discussion started by: svhyd
2 Replies

7. Shell Programming and Scripting

Issue with running commands from shell script

I'm trying to copy files from a remote windows server to Unix server. I was successfully able to copy files from windows server using command prompt but when I run these commands from a script it's not working as expected. commands used: sftp user@remoteserver.com lcd local_dir cd... (3 Replies)
Discussion started by: naresh7590
3 Replies

8. Shell Programming and Scripting

Issue with quotes when running SQL command from within su -c

RHEL 6.2/Bash shell root user will be executing the below script. It switches to oracle user logs in using sqlplus and tries to run the below UPDATE statement. All the commands after su -c are enclosed in a single quote delimited by semicolon. The execution has failed because the quotes... (3 Replies)
Discussion started by: omega3
3 Replies

9. Shell Programming and Scripting

Perl script running multiple commands at once

Hi All, I have put a perl script together to go and collect some information from multiple nodes/endpoints. The script works absolutly fine however I want to make it quicker. You will see in the below that my script calls an expect script called ssh_run_cmd2.exp followed by the IP of... (7 Replies)
Discussion started by: mutley2202
7 Replies

10. Shell Programming and Scripting

Check status of long running multiple curl commands in shell script

I am working on script. it reads a file which contains multiple lines Ex; curl --write-out %{http_code} --silent --output /dev/null http://hostname:port/input=1 curl --write-out %{http_code} --silent --output /dev/null http://hostname:port/input=2 curl --write-out %{http_code} --silent ... (2 Replies)
Discussion started by: oraclermanpt
2 Replies
Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuPerl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters(3pm)

NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters - Don't use quotes ("'", """, "`") as delimiters for the quote-like operators. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
With the obvious exception of using single-quotes to prevent interpolation, using quotes with the quote-like operators kind of defeats the purpose of them and produces obfuscated code, causing problems for future maintainers and their editors/IDEs. $x = q"q"; #not ok $x = q'q'; #not ok $x = q`q`; #not ok $x = qq"q"; #not ok $x = qr"r"; #not ok $x = qw"w"; #not ok $x = qx`date`; #not ok $x =~ m"m"; #not ok $x =~ s"s"x"; #not ok $x =~ tr"t"r"; #not ok $x =~ y"x"y"; #not ok $x =~ m'$x'; #ok $x =~ s'$x'y'; #ok $x = qr'$x'm; #ok $x = qx'finger foo@bar'; #ok CONFIGURATION
This policy has three options: "single_quote_allowed_operators", "double_quote_allowed_operators", and "back_quote_allowed_operators", which control which operators are allowed to use each of "'", """, "`" as delimiters, respectively. The values allowed for these options are a whitespace delimited selection of the "m", "q", "qq", "qr", "qw", "qx", "s", "tr", and "y" operators. By default, double quotes and back quotes (backticks) are not allowed as delimiters for any operators and single quotes are allowed as delimiters for the "m", "qr", "qx", and "s" operators. These defaults are equivalent to having the following in your .perlcriticrc: [ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters] single_quote_allowed_operators = m s qr qx double_quote_allowed_operators = back_quote_allowed_operators = SUGGESTED BY
Michael Schwern AUTHOR
Elliot Shank "<perl@galumph.com>" COPYRIGHT
Copyright (c) 2007-2011 Elliot Shank. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 Perl::Critic::Policy::ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters(3pm)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy