Sponsored Content
Top Forums Shell Programming and Scripting Shell Script problem $( vs ticks [`] Post 302435671 by Scrutinizer on Thursday 8th of July 2010 01:16:20 AM
Old 07-08-2010
On Solaris /bin/sh for some strange reason still points to an actual real Bourne Shell instead of a POSIX shell. Try to using a POSIX shell by putting
Code:
#!/usr/xpg4/bin/sh

as the first line of your script (I believe it is pointing to a ksh), or use ksh93 that possibly is available on your system.

Quote:
Originally Posted by SkySmart
.. i have tried using different shells - bash, ksh, sh - same thing.
That is strange. The first two should understand $( ).

Last edited by Scrutinizer; 07-08-2010 at 02:32 AM..
 

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
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/ksh93 /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/ksh93 /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/sfw/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. NOTES
Restricted shells should not be listed in /etc/shells. SunOS 5.11 1 Nov 2007 getusershell(3C)
All times are GMT -4. The time now is 12:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy