Join Today
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    785

    Default .lin script: file test problem

    i want to make a .lin script that activates (add to startup folder) or deactivates (remove from startup folder) another file.
    The problem is that this test:
    [-e /mmc/mmca1/startup/poweronlog.lin]
    has some certain problem because it always returns false so it always showing "Activate" instead of switching between "Activate" and "Deactivate" (the functionallity is the same.. always does the activation process.. never went through the other side of the if statement)

    here's the script:

    #!/bin/bash

    if [-e /mmc/mmca1/startup/poweronlog.lin];
    then
    buton="Deactivate"
    else
    buton="Activate"
    fi

    mmsg=`showQ -t30 -1 $buton -2 "Cancel" -m "PowerOn phone time logger"`

    if [ "$mmsg" = "0" ]
    then
    if [-e /mmc/mmca1/startup/poweronlog.lin] then
    mv /mmc/mmca1/startup/poweronlog.lin /mmc/mmca1/startup/inactive/
    else
    mv /mmc/mmca1/startup/inactive/poweronlog.lin /mmc/mmca1/startup/
    fi
    exit
    fi
    if [ "$mmsg" = "1" ]
    then
    exit
    fi

  2. #2
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    785

    Default

    finally i made it work by simply adding a space to left and one to right between the []
    [ -e /mmc/mmca1/startup/poweronlog.lin ]
    edit:
    if you notice other problems in my script please tell me because i'm quite unfamiliar with the linux commands and environment and i'm just starting to learn
    Last edited by BruceLee; 02-21-2008 at 07:33 AM. Reason: add


 
+ Reply to Thread

Similar Threads

  1. Q: How do I make a .lin file to run a script?
    By macnick in forum A1200 General Chat
    Replies: 18
    Last Post: 11-30-2007, 06:15 PM
  2. How to run lin script at start-up automatically
    By bonalir in forum E6 General Chat
    Replies: 1
    Last Post: 10-11-2007, 03:34 PM
  3. Can Lin script make phone speak.
    By eakrin in forum Development
    Replies: 5
    Last Post: 01-18-2006, 06:09 AM
  4. How to start java midlet from lin script
    By eakrin in forum Development
    Replies: 13
    Last Post: 11-13-2005, 07:10 AM
  5. a script that activated lin-loader + startup.lin
    By ycyas in forum E680 General Chat
    Replies: 0
    Last Post: 11-04-2005, 06:55 AM

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