Sponsored Content
Top Forums Shell Programming and Scripting shell script, echo doesn't work Post 302356286 by cola on Friday 25th of September 2009 05:27:10 AM
Old 09-25-2009
shell script, echo doesn't work

Code:
  #!/bin/sh
  something(){
      echo "Inside something"
      echo $1 $2
  }
  val=$(something "Hello " "world")

Output expected:
Code:
Inside somethingHello world

But it's not echoing.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep doesn't work within shell script?

I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong. When I copy and paste it to the terminal, it is OK. Any idea what the problem might be? set i = `grep -c #define flags.h` while ($i>20) @ i-- my func (`cat... (4 Replies)
Discussion started by: barisgultekin
4 Replies

2. UNIX for Dummies Questions & Answers

bash pattern matching echo *[! '/' ] doesn't work

without using ls, just using echo so purely pattern matching I can say echo */ <-- lists directories but how would I match files? surely something like *!/ or * but neither work ? it seems like there isn't much that I can put in but surely i should be able to put any ascii... (1 Reply)
Discussion started by: james hanley
1 Replies

3. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

4. Shell Programming and Scripting

Perl cmds doesn't work in Bash shell . Plz help

Hi everyone, I have a Linux OS in my PC (older version 9). Its default shell is bash. Whenever I try to run some Perl program it throws error ! eg, if I run this simple PERL program , #!/usr/bin/perl printf "\lHello \n"; $var=3 ; printf $var; @list=(1,2,3); printf "@list";... (6 Replies)
Discussion started by: adc22
6 Replies

5. Shell Programming and Scripting

echo $PWD doesn't work

I have entry in the my .profile like below, but still i see $PWD is not defied in my system export PS1=$LOGNAME@`hostname`':'$PWD'>' echo $PWD also gives me nothing, my env list also give no entry for PWD.Can someone help me setting PWD variable. I use /bin/sh (9 Replies)
Discussion started by: yesmani
9 Replies

6. Shell Programming and Scripting

echo doesn't work right

Hi,when I run my first shell script,I got something that doesn't work right. I wrote this code in the script. echo -e "Hello,World\a\n"But the screen print like this: -e Hello,World The "-e" wasn't supposed to be printed out. Can anyone help me out?:wall: Many thanks!:) (25 Replies)
Discussion started by: Demon
25 Replies

7. UNIX for Dummies Questions & Answers

find command in shell script doesn't work

Hello all, Something strange going on with a shell script I'm writing. It's trying to write a list of files that it finds in a given directory to another file. But I also have a skip list so matching files that are in that skip list should be, well uhm, skipped :) Here's the code of my... (2 Replies)
Discussion started by: StijnV
2 Replies

8. Shell Programming and Scripting

Switching user inside a shell script doesn't seem to work

Linux version : Oracle Linux 6.4 Shell : Bash The following script will be run as root. During the execution, it should switch to oracle user and execute few commands. After googling and searching within unix.com , I came up with the following syntax ## Enclosing all commands in double... (7 Replies)
Discussion started by: John K
7 Replies

9. HP-UX

Su to another user from root doesn't work within shell script

Hello I have a shell script that is run as root. Script rins ok until the point where it have to switch to user "mqm" to run other commands. It just hangs at the point of this line in the script su - mqm -c "dspmq" I ran the same commands at the terminal and they run fine. Any thoughts. (6 Replies)
Discussion started by: mo12
6 Replies

10. UNIX for Beginners Questions & Answers

C shell concatenate string doesn't work

I have the following code: #!/bin/csh clear set cloud_file="/home/labs/koren/davidsr/general_scripts/MFP_10_PP_Parmas.txt" # to fill set mie_tables_dir='/home/labs/koren/davidsr/SHDOM_MAIN/MIE_TABLES/non_polo_wave_0.7_water_50R_s0.5_e25_max_70.mie' # to fill set prp_dir='${pp_dir}/pp_prp/'... (2 Replies)
Discussion started by: student_wiz
2 Replies
IMAP_RFC822_PARSE_ADRLIST(3)						 1					      IMAP_RFC822_PARSE_ADRLIST(3)

imap_rfc822_parse_adrlist - Parses an address string

SYNOPSIS
array imap_rfc822_parse_adrlist (string $address, string $default_host) DESCRIPTION
Parses the address string as defined in RFC2822 and for each address. PARAMETERS
o $address - A string containing addresses o $default_host - The default host name RETURN VALUES
Returns an array of objects. The objects properties are: o mailbox - the mailbox name (username) o host - the host name o personal - the personal name o adl - at domain source route EXAMPLES
Example #1 imap_rfc822_parse_adrlist(3) example <?php $address_string = "Joe Doe <doe@example.com>, postmaster@example.com, root"; $address_array = imap_rfc822_parse_adrlist($address_string, "example.com"); if (!is_array($address_array) || count($address_array) < 1) { die("something is wrong "); } foreach ($address_array as $id => $val) { echo "# $id "; echo " mailbox : " . $val->mailbox . " "; echo " host : " . $val->host . " "; echo " personal: " . $val->personal . " "; echo " adl : " . $val->adl . " "; } ?> The above example will output: # 0 mailbox : doe host : example.com personal: Joe Doe adl : # 1 mailbox : postmaster host : example.com personal: adl : # 2 mailbox : root host : example.com personal: adl : SEE ALSO
imap_rfc822_parse_headers(3). PHP Documentation Group IMAP_RFC822_PARSE_ADRLIST(3)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy