Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shell scipt doubts

    Hello please kindly solve these doubts i have about the following scripts

    Code:
    Script 1
    //Shell script that accepts arguments and prints them in reverse 
    order//
    echo "number of arguments"
    len=$#;
    while [ $len -ne 0 ]
    do
    eval echo \$$len
    len=`expr $len - 1`
    done
    
    ---------
    Output
    $sh test.sh a b
    b
    a
    1.what is \$$len.what is the significance of the escape sequence


    Script 2
    Code:
    //Bundle shell script that accepts file name as arguments and create a shell script that has
     the file as well as the code to recreate the 
    files.Thus if the script generated by your 
    script is executed it would recreate the original file//
    
    echo "#to bundle ,sh this file"
    for i in $*
    do
    echo "echo $i 1>&2"
    echo "cat > $i <<'end of $i'"
    cat $i
    echo " end of $i"
    done
    
    
    ---------------
    Output
    $cat f1
    hi
    $cat f2
    hello
    $sh test.sh f1 f2 >new.sh
    $rm f1 f2
    $sh new.sh
    f1
    f2
    1.Even though the 1st line is a simple print statement if i write something difrrent i get the following error message "new.sh: line 1: to: command not found".Can u tell me why do i get this message
    2.In the 4th line what does 1>&2 mean
    3.Is "end of" a command and what does "<<" mean.

  • #2
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hello
    I dont have idea about inserting dropdown in gridview
    how to insert dropdown control in gridview control can you please me


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •