Sponsored Content
Operating Systems SCO Long file names within shell script Post 302992280 by bakunin on Thursday 23rd of February 2017 01:44:15 PM
Old 02-23-2017
Quote:
Originally Posted by migurus
the shebang line needs to be corrected, do not place a space between exclamation mark and slash, type it like this
Code:
 
 #!/bin/ksh

Sorry, but this is not correct: in fact both shebang lines:

Code:
#! /path/to/interpreter

and
Code:
#!/path/to/interpreter

will work because the three-byte "magic number" "#!/" as well as the 4-byte magic number "#! /" is built into the UNIX-kernel. You need to use absolute pathes, though, and i.e.

Code:
#! ../path/to/interpreter

will not work, regardless of a space being there or not.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

linux question, pardon, on long file names

Sorry, hope no one minds the linux question here, I use both unix and linux, and have come across a problem. On my linux box i have a dual boot, and i've set it up so i can access my windows data partition while in linux mode (mount the vfat partition), but linux doesn't recognize long file names,... (2 Replies)
Discussion started by: kymberm
2 Replies

2. Windows & DOS: Issues & Discussions

Dos window, long file names prob

At the dos command prompt, does anyone remember how to make it recognize long file names? ie, windows long file names for folders, my documents, if i'm at the :> prompt and want to change to that directory, how do i make it skip the space? I've tried cd "my document" cd my\documents cd 'my... (4 Replies)
Discussion started by: kymberm
4 Replies

3. Solaris

mkisofs and long file names

Well im using mkisofs to create iso images in Solaris 10 and then i use cdrw -i to burn the images to the cd the problem which i noticed recent ( im new to mkisofs) i noticed its break the long file names making them shorter i searched in its help and i find two parameters one -l and one... (2 Replies)
Discussion started by: XP_2600
2 Replies

4. UNIX for Dummies Questions & Answers

Displaying VERY long process names with ps -ef

Hi, I'm trying to display all process on an AIX server with the string SLRServer in them. Normally "ps -ef|grep SLRServer" would be sufficient, however in this instance the process name is enormous and the part which contains this string has been truncated, as you can see in the example below ... (8 Replies)
Discussion started by: m223464
8 Replies

5. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

6. Shell Programming and Scripting

Dealing with spaces in file names in a shell script

Hi, What's the best way to find all files under a directory - including ones with space - in order to apply a command to each of them. For instance I want get a list of files under a directory and generate a checksum for each file. Here's the csh script: #!/bin/csh set files = `find $1... (5 Replies)
Discussion started by: same1290
5 Replies

7. Shell Programming and Scripting

Renaming file names in a shell script

I want to write a shell script that will rename all the file names to today's date attached to it.. so for example i have a file names like file1.sales.20081201.txt.c zbrs.salestxtn.20091101.txt.inn then it will rename both the files with todays date to it so the file names get changed... (1 Reply)
Discussion started by: rudoraj
1 Replies

8. Shell Programming and Scripting

want only file names (not whole path) in shell script

hi i wrote following script, #!/usr/bin/sh for index in `ls /tmp/common/*.txt` do echo "$index" done here index is giving full path but in my program i want only file names (not along with whole path) Eg. if in /tmp/common files are a.txt and b.txt den out should be a.txt b.txt ... (6 Replies)
Discussion started by: crackthehit007
6 Replies

9. Shell Programming and Scripting

Find and rename long file names (html)

Hi Guys, I need a help. I have 1130 zip files. Each one of them has files including 1 html file with long file name (includes special charactors, Alphabetic and numbers). I have copied all 1130 zip files to my linux system and extracted using below command. Find . -name "*.zip" -exec... (7 Replies)
Discussion started by: Rajmani
7 Replies

10. UNIX for Advanced & Expert Users

script regarding listing long group names

Hello, When listing the file systems (using ls -ltr) , if the group names are longer the group name is getting truncated. Can someone help with the script which would display the truncated group name? I appreciate if someone could help in this regard. (1 Reply)
Discussion started by: mike12
1 Replies
BINMISCCTL(8)						    BSD System Manager's Manual 					     BINMISCCTL(8)

NAME
binmiscctl -- manage binary image activators SYNOPSIS
binmiscctl add name --interpreter path --magic magic --size size [--mask mask] [--offset offset] [--set-enabled] binmiscctl remove name binmiscctl disable name binmiscctl enable name binmiscctl lookup name binmiscctl list DESCRIPTION
The binmiscctl utility is the management utility for configuring miscellaneous binaries image activators in the kernel. It allows adding, deleting, disabling, enabling, and looking up interpreters. Also, all the interpreters can be listed. The first argument on the command line indicates the operation to be performed. Operation must be one of the following: add name --interpreter path --magic magic --size size [--mask mask] [--offset offset] [--set-enabled] Add a new activator entry in the kernel. You must specify a unique name, interpreter path and its arguments path, header magic bytes that uniquely identify a suitable binary for the activator, and the size of the magic in bytes. Optionally you may specify a mask to do a bitwise AND with the header bytes. This effectively allows you to ignore fields in the binary header that do not uniquely indentify the binary file's type. An offset may be specified for the magic bytes using the --offset option. By default the offset is zero. To enable the activator entry the --set-enabled option is used. The activator default state is disabled. The interpreter path may also contain arguments for the interpreter including #a which gets replaced by the old argv0 value in the interpreter string. remove name Remove the activator entry identified with name. disable name Disable the activator entry identified with name. enable name Enable the activator entry identified with name. lookup name Look up and print out the activator entry identified with name. list Take a snapshot and print all the activator entries currently configured. EXAMPLES
Add an image activator to run the LLVM interpreter (lli) on bitcode compiled files: # binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' --magic ''BCxc0xde'' --size 4 --set-enabled #a is replaced with the old argv0 value so that 'lli' can fake its argv0. Set its state to enabled. Set the state of the llvmbc image activator to disabled: # binmiscctl disable llvmbc Set the state of the llvmbc image activator to enabled: # binmiscctl enable llvmbc Delete the llvmbc image activator: # binmiscctl remove llvmbc Look up and list the record for the llvmbc image activator: # binmiscctl lookup llvmbc Add QEMU bsd-user program as an image activator for ARM AARCH64 binaries: # binmiscctl add arm64 --interpreter "/usr/local/bin/qemu-aarch64-static" --magic "x7fx45x4cx46x02x01x01x00x00x00 x00x00x00x00x00x00x02x00xb7x00" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxfexffxffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for ARM little-endian binaries: # binmiscctl add armelf --interpreter "/usr/local/bin/qemu-arm-static" --magic "x7fx45x4cx46x01x01x01x00x00x00 x00x00x00x00x00x00x02x00x28x00" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxfexffxffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for ARM big-endian binaries: # binmiscctl add armebelf --interpreter "/usr/local/bin/qemu-arm-static" --magic "x7fx45x4cx46x01x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x28" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for MIPS32 binaries: # binmiscctl add mips32 --interpreter "/usr/local/bin/qemu-mips-static" --magic "x7fx45x4cx46x01x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x08" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for MIPS64 binaries: # binmiscctl add mips64 --interpreter "/usr/local/bin/qemu-mips64-static" --magic "x7fx45x4cx46x02x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x08" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for PowerPC binaries: # binmiscctl add powerpc --interpreter "/usr/local/bin/qemu-ppc-static" --magic "x7fx45x4cx46x01x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x14" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for PowerPC64 binaries: # binmiscctl add powerpc64 --interpreter "/usr/local/bin/qemu-ppc64-static" --magic "x7fx45x4cx46x01x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x15" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Add QEMU bsd-user program as an image activator for SPARC64 binaries: # binmiscctl add sparc64 --interpreter "/usr/local/bin/qemu-sparc64-static" --magic "x7fx45x4cx46x02x02x01x00x00x00 x00x00x00x00x00x00x00x02x00x2b" --mask "xffxffxffxffxffxffxffx00xffxff xffxffxffxffxffxffxffxfexffxff" --size 20 --set-enabled Create and use an ARMv6 chroot on an AMD64 host Use an existing source tree to build a chroot host with architecture overrides: D=/path/to/chroot cd /usr/src mkdir -p $D make world TARGET=arm TARGET_ARCH=armv6 DESTDIR=$D make distribution TARGET=arm TARGET_ARCH=armv6 DESTDIR=$D With emulators/qemu-user-static from the FreeBSD Ports Collection, the emulator must be copied into the jail path specified in the binmiscctl command. Using the example above: mkdir $D/usr/local/bin cp /usr/local/bin/qemu-arm-static $D/usr/local/bin Now the user can chroot into the environment normally, as root: chroot $D SEE ALSO
lli(1), execve(2), jail(8) HISTORY
The binmiscctl command was added in FreeBSD 10.1. It was developed to support the imgact_binmisc kernel module. AUTHORS
Stacey D Son BSD
December 30, 2014 BSD
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy