Jump to content

Script question


  • Please log in to reply
8 replies to this topic

#1
eddie11c

eddie11c

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 772 posts
I am trying to add a script into an installer to make an alias. Can I not use the ln command in bash? if so is the usage different somehow? ln -s <target> <alias> is what i have tried, I get no error during the script, but also don't see any alias output. I can do the command just fine in terminal and I do require root authorization. Any ideas? I want to create an alias as opposed to installing a premade one..

#2
ritalin

ritalin

    InsanelyMac Protégé

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:A dull, bluish green, planet
ln -s ${1} ${2} works in #!/bin/bash or #!/bin/sh on my machine.

In what context are you trying to use it?

#3
eddie11c

eddie11c

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 772 posts
During my custom install DVD I want to create some alias'. I tried ln -s "$3/target" "$3/alias", and even tried pointing to the ln command /bin/ln, it doesn't spit out any errors about not finding the file or that it already exists, but yet there is no output that I can see. Maybe my syntax is incorrect. If you could post an example of what is working?

Lets make up a file called test that is located in /System/Library/Filesystems/Example of the target Volume $3 and want an alias created in the same volume in /usr/bin. ln -s "$3/System/Library/Filesystems/Example/test" "$3/usr/bin/test" but this is not working. Any help would be appreciated.

#4
ritalin

ritalin

    InsanelyMac Protégé

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:A dull, bluish green, planet
Where in the installer will this command being called from?

InstallationCheck
VolumeCheck
preflight
postflight...Etc

Is volume referenced by $3 definitely mounted at the point in time in question?

When I said it was working in bash and sh, that was just a quick test from a shell script on my desktop, not from a running Installer. I will try again from my live/install memory stick.

#5
eddie11c

eddie11c

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 772 posts
Yes the target volume is mounted and defined as $3 during install. This script would be attached as postinstall of a package.

#6
ritalin

ritalin

    InsanelyMac Protégé

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:A dull, bluish green, planet
Okay, I'll build a pkg and try it. Back in a mo..... Yes, it works fine.

#7
eddie11c

eddie11c

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 772 posts

Okay, I'll build a pkg and try it. Back in a mo..... Yes, it works fine.


And the syntax I had was correct? If so I will have to double check it again for a typo or something.

#8
ritalin

ritalin

    InsanelyMac Protégé

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:A dull, bluish green, planet
Here is a link to the pkg I used to run the test.

#9
siddddddo

siddddddo

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
I want to study x-script..





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy