Join Today
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Location
    Tehran, Iran
    Posts
    288

    Default Help: bash script and "showFolder" binary

    I wanna use "showFolder" and specify the patch and store it to an string...
    all I have is this working script:
    #!/bin/bash
    . /home/native/.profile
    myfile=`basename $0`
    mypath=`echo $0 | sed -e 's/'$myfile'//g'`
    SelectedFolder=`${mypath}showFolder | sed -n 's/#curfolder#://gp'`
    if [ "$SelectedFolder" = "" ]
    then
    echo "Error"
    else
    echo "CurrFolder: "${SelectedFolder}
    fi
    How should I modify that script?
    Amin's Persian Gulf firmware has been updated(9/2/2010)


    "We share the same biology, regardless of ideology..."

  2. #2

    Default

    if u want to take arguments from command line check this out:

    #!/bin/sh
    CalledByName=$0
    Arg1=$1;
    Arg2=$2;
    Arg3=$3;
    ...
    Arg9=$9;
    #ARG10=$10 ## that's don't work!
    How to use more that 9 Arguments? No Problem!
    Arg1=$1; shift;
    Arg2=$1; shift;
    Arg3=$1; shift;
    ...
    Arg10=$1; shift;
    ...
    Did i answer your Question?

  3. #3

    Default

    I think use curly brackets like ${10} will work too...

  4. #4

    Default

    I didn't test it!
    #!/bin/bash
    . /home/native/.profile
    #one should do the right:
    #mypath=${0%/*}
    #mypath=${0#/*}
    SelectedFolder=$(${mypath}/showFolder | sed -n 's/#curfolder#://gp')
    [ $SelectedFolder ] && echo "CurrFolder: ${SelectedFolder}" || echo "Error"
    Don't know if it's work but it looks less wired


 
+ Reply to Thread

Similar Threads

  1. Any "Secret Codes" or "Tweaks" for the Z10?
    By eL_MeXiCaNo in forum Motorola Z10
    Replies: 1
    Last Post: 12-27-2011, 09:20 AM
  2. Replies: 0
    Last Post: 07-02-2009, 12:30 PM
  3. Replies: 7
    Last Post: 06-02-2008, 11:16 AM
  4. Q: How can i "busy" or "ignore" a incoming call in flip mode?
    By zeroonea in forum A1200 General Chat
    Replies: 4
    Last Post: 04-15-2008, 06:41 AM
  5. "Missed Calls" "Messages" dont display
    By wizard1 in forum A1200 General Chat
    Replies: 5
    Last Post: 08-02-2007, 10:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Optimization by vBSEO 3.6.0 RC 1