Sponsored Content
Top Forums Shell Programming and Scripting Shell Script problem $( vs ticks [`] Post 302435657 by SkySmart on Thursday 8th of July 2010 12:10:11 AM
Old 07-08-2010
Shell Script problem $( vs ticks [`]

ok so, I recently started using
Code:
$(echo one two three)

to execute commands in scripts instead of using
Code:
`echo one two three`

.

This method works wonderfully on ubuntu. However, it doesn't seem to work on other unix systems, i.e redhat/sun sun solaris.

I really hate to go back to the ticks "`" so i'm wondering if anyone here knows of a way around this.

when i run a script containing GECKO=$(echo one two three) on a non-ubuntu box, i get some type of error similar to :

Code:
: syntax error at line 175: `MONTH=$' unexpected

i have tried using different shells - bash, ksh, sh - same thing.

Any suggestions?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script problem

shell script for sorting,searchingand insertion/deletion of elements in a list (1 Reply)
Discussion started by: jayaram_miryabb
1 Replies

2. HP-UX

Ticks in seconds.

Hello all, Is there any thumb rule or aproximation of the equivalence in second of one tick? Thank you in advance. (1 Reply)
Discussion started by: mig28mx
1 Replies

3. Shell Programming and Scripting

Problem in shell script

HOSTNAME=`uname -n` /usr/sbin/clinfo CLUSTERACTIVE=$? # First check whether the Cluster itself is active if then echo Cluster is NOT ACTIVE - EXITING exit 1 fi # Now check whether we are on the active Cluster Node for this Resource Group... (2 Replies)
Discussion started by: babu.knb
2 Replies

4. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

5. Shell Programming and Scripting

shell script problem

Hey there, I`m a beginner so don`t be brutall with me if it`s a stupid or easy question. I need to make a script that 1) reads from a text file with this pattern: 2) and i need it to insert the #defines in the .c files Problem is, that i`m working in a batch file,from within... (3 Replies)
Discussion started by: mad_igor
3 Replies

6. Shell Programming and Scripting

shell script , $$ problem

dialog --title "Inputbox - To take input from you" --backtitle "Linux Shell\ Script Tutorial" --inputbox "Enter your name please" 8 60 2>/tmp/input.$$ sel=$? na=`cat /tmp/input.$$` case $sel in 0) echo "Hello $na" ;; 1) echo "Cancel is Press" ;; 255) echo " key pressed" ;; ... (7 Replies)
Discussion started by: cola
7 Replies

7. Shell Programming and Scripting

Passing variable to Expression in back ticks.

Hi, In my perl script I want to check whether *.csv files exist and take the count . Below is the code: $path = “/home/usr/jan/myfiles” my $File_Count = `ls *.csv | wc -l `; # Checks in the current directory #Works fine if files exists. my $File_Count = `ls $path/*.csv | wc -l `; # I need... (2 Replies)
Discussion started by: jisha
2 Replies

8. Shell Programming and Scripting

Shell script newbie, what is problem with my script?

Hello, Ubuntu server 11.10 can anybody help what is problem with my shell script? #!/bin/bash #script to find out currently logged on user is root or not. if ] then echo "You are super" else echo "You are awesome!" fi When I run script, I get following output ./uid: line 3: I... (4 Replies)
Discussion started by: kaustubh
4 Replies

9. Shell Programming and Scripting

Back ticks and $()

In one of my previous threads, someone suggested not to use backticks. When I googled, I came to know that back ticks are deprecated instead $() should be used. But I face issue while using $(). Note: I used echo of the sql just to debug. The following is the code #!/bin/ksh #set -x... (5 Replies)
Discussion started by: bobbygsk
5 Replies
AMZFS-SNAPSHOT(8)					  System Administration Commands					 AMZFS-SNAPSHOT(8)

NAME
amzfs-snapshot - Amanda script to create zfs snapshot DESCRIPTION
amzfs-snapshot is an Amanda script implementing the Script API. It should not be run by users directly. It create a zfs snapshot of the filesystem where the path specified is mounted. PRE-DLE-* create a snapshot and the POST-DLE-* destroy the snapshot, *-DLE-AMCHECK, *-DLE-ESTIMATE and *-DLE-BACKUP must be set to be executed on the client: execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup execute-where client The PRE_DLE_* script output a DIRECTORY property telling where the directory is located in the snapshot. The application must be able to use the DIRECTORY property, amgtar can do it. The script is run as the amanda user, it must have the priviledge to create and destroy snapshot: zfs allow -ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM Some system doesn't have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command: usermod -P "ZFS File System Management,ZFS Storage Management" AMANDA_USER This will require that your run zfs under pfexec, set the PFEXEC property to YES. The format of the DLE must be one of: Desciption Example ---------- ------- Mountpoint /data Arbitrary mounted dir /data/interesting_dir ZFS pool name datapool ZFS filesystem datapool/database ZFS logical volume datapool/dbvol The filesystem must be mounted. PROPERTIES
This section lists the properties that control amzfs-snapshot's functionality. See amanda-scripts(7) for information on the Script API, script configuration. DF-PATH Path to the 'df' binary, search in $PATH by default. ZFS-PATH Path to the 'zfs' binary, search in $PATH by default. PFEXEC-PATH Path to the 'pfexec' binary, search in $PATH by default. PFEXEC If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used. EXAMPLE
In this example, a dumptype is defined to use amzfs-snapshot script to create a snapshot and use amgtar to backup the snapshot. define script-tool amzfs_snapshot { comment "backup of zfs snapshot" plugin "amzfs-snapshot" execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup execute-where client #property "DF-PATH" "/usr/sbin/df" #property "ZFS-PATH" "/usr/sbin/zfs" #property "PFEXEC-PATH" "/usr/sbin/pfexec" #property "PFEXEC" "NO" } define dumptype user-zfs-amgtar { dt_amgtar script "amzfs_snapshot" } SEE ALSO
amanda(8), amanda.conf(5), amanda-client.conf(5), amanda-scripts(7) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Jean-Louis Martineau <martineau@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Dustin J. Mitchell <dustin@zmanda.com> Zmanda, Inc. (http://www.zmanda.com) Amanda 3.3.3 01/10/2013 AMZFS-SNAPSHOT(8)
All times are GMT -4. The time now is 09:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy