Sponsored Content
Full Discussion: Variable issues
Top Forums Shell Programming and Scripting Variable issues Post 302250797 by bert682 on Friday 24th of October 2008 09:32:29 AM
Old 10-24-2008
Thanks so much, did the trick.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if [ -f "$variable" ]; then issues, help!

Im trying to write a /bin/bash script that refreshes VMware Fusion using the built in snapshot capabilities. I am having an issue getting a variable to pass into the find argument of an "if-then" statement. Im thinking the problem might have something to do with the working directory of the... (8 Replies)
Discussion started by: afriend
8 Replies

2. Shell Programming and Scripting

variable issues

Hope someone can help me. I have 2 outputs 1 2 3 4 5 a b c d e basically, I'd like to loop thru these outputs and print out the results below 1/a 2/b 3/c 4/d 5/e Thanks, (16 Replies)
Discussion started by: kkkk
16 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

5. Shell Programming and Scripting

Split variable length and variable format CSV file

Dear all, I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file. The file length will depend on the numbers of Earnings/Deductions/Direct Deposits. And The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies

6. Solaris

Scripiting quote and variable issues

Hello all I have an interesting problem here that I can't seem to figure out. Note this exists inside a script with the following header: m#!/usr/bin/sh What I am trying to do is build an automounting script for USB hdd's, the idea is that the user plugs their drive in then runs the script. The... (5 Replies)
Discussion started by: striker0010
5 Replies

7. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

8. Shell Programming and Scripting

Awk Issues - Not printing the 10th Variable.

All, I am attempting to print the tenth ($COPY2) varaibales into one file. But i am finding that all variables are being outputted except for $10. Can someone help!!!! Code Below ---------- echo $SERVER $IMAGE $IMAGEDAY $IMAGEMONTH $IMAGEYEAR $COPY1 $EXPIREDAY $EXPIREMONTH... (1 Reply)
Discussion started by: Junes
1 Replies

9. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

10. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies
ESCAPESHELLCMD(3)							 1							 ESCAPESHELLCMD(3)

escapeshellcmd - Escape shell metacharacters

SYNOPSIS
string escapeshellcmd (string $command) DESCRIPTION
escapeshellcmd(3) escapes any characters in a string that might be used to trick a shell command into executing arbitrary commands. This function should be used to make sure that any data coming from user input is escaped before this data is passed to the exec(3) or system(3) functions, or to the backtick operator. Following characters are preceded by a backslash: #&;`|*?~<>^()[]{}$, x0A and xFF. ' and " are escaped only if they are not paired. In Windows, all these characters plus % are replaced by a space instead. PARAMETERS
o $command - The command that will be escaped. RETURN VALUES
The escaped string. EXAMPLES
Example #1 escapeshellcmd(3) example <?php // We allow arbitrary number of arguments intentionally here. $command = './configure '.$_POST['configure_options']; $escaped_command = escapeshellcmd($command); system($escaped_command); ?> Warning escapeshellcmd(3) should be used on the whole command string, and it still allows the attacker to pass arbitrary number of argu- ments. For escaping a single argument escapeshellarg(3) should be used instead. SEE ALSO
escapeshellarg(3), exec(3), popen(3), system(3), backtick operator. PHP Documentation Group ESCAPESHELLCMD(3)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy