Sponsored Content
Top Forums Shell Programming and Scripting Builtin alternatives for several commands? Post 302945489 by Michael Stora on Friday 29th of May 2015 05:59:09 PM
Old 05-29-2015
Builtin alternatives for several commands?

I'm adapting a BASH script to run with an absolute minimal amounts of Cygwin64 files so colleagues using Windows can use it without installing Cygwin.
I am down to the following in /bin only (replacing cut with parameter substitution eliminated all needed things in /etc)
Code:
bash.exe
cygattr-1.dll
cygiconv-2.dll
cygintl-8.dll
cygncursesw-10.dll
cygreadline7.dll
cygwin1.dll
cygwin-console-helper.exe (mintty misbehaves without this)
find.exe (using a wildcard, directory type, recursion, and file attribute output so replacement unlikely): $( find "$dataDir" -type d -name '*.aps' -printf '%T@|%p\n' -prune | sort -nr )
ls.exe (expanding * and suppressing whitespace with OFS=$'\n'): $(ls -dr "${apsFolder[$apsIn]}""/Run"*)
mintty.exe (used to support ANSI bold, underline, etc.)
mv.exe (I think I can replace this with a > and then rm): mv "${runFolder[$runIn]}" "${apsFolder[$apsIn]}""/Run""$padded"" - ""$newName"
rename.exe (using * wildcard): rename "$runName" "$newName" "$excelFolder""/"*".csv"
rm.exe: rm "${runFolder[$runIn]}""/comm" &>/dev/null
sed.exe (already planning on replacing with ${var/Pattern/Replacement})
sort.exe: $( find "$dataDir" -type d -name '*.aps' -printf '%T@|%p\n' -prune | sort -nr )
stat.exe: dateStamp=$(stat -c '%y' "$i") (keep in mind these are windows files either on the users hard drive or a windows share)

Any low handing fruit? No need to write the code for me just point me in the right direction.

Mike

---------- Post updated at 02:59 PM ---------- Previous update was at 02:44 PM ----------

Update: looks like find is (sometimes?) needing something in /etc as well (cant be all the time or I could not have been able to test cut). Any trick to find out what other than trial and error (what I used so far)?

Mike

Last edited by Michael Stora; 05-29-2015 at 08:43 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ASP alternatives

I have just found out that a project I have developed in ASP (ultradev) needs to be migrated to a unix server and won't be able to support asp. Can anyone point me in the right direction to see what my options are with Unix? I have never worked with or developed for a Unix box before. Also,... (3 Replies)
Discussion started by: Ricki
3 Replies

2. UNIX for Advanced & Expert Users

Alternatives for CLOCK_MONOTONIC

Hi, I need to develop timeout functionality in my code, which is not affected by system's time changes.Unfortunately I dont have CLOCK_MONOTONIC support in my OS. Are there any alternatives? (3 Replies)
Discussion started by: amitks21
3 Replies

3. Shell Programming and Scripting

The builtin split function in AWK is too slow

I have a text file that contains 4 million lines, each line contains 2 fields(colon as field separator). as shown: 123:444,555,666,777,888,345 233:5444,555,666,777,888,345 623:454,585,664,773,888,345 ...... Here I have to split the second field(can be up to 40,000 fields) by comma into an... (14 Replies)
Discussion started by: kevintse
14 Replies

4. Red Hat

Alternatives for sudo??

I am looking for an alternative for sudo in linux, where i need not type the password. OR is there any other version of 'growisofs', which can be executed under sudo??? As currently 'growisofs' refuses to start under sudo... Thanks in advance (12 Replies)
Discussion started by: sony star
12 Replies

5. UNIX for Dummies Questions & Answers

Unix Builtin commands

Hi, In unix ls command is found in /bin/ls. Similarly where can I find built-in commands like read, set, unset commands. I found in some couple of websites saying found in bash tool set. In unix everything is considered as a type of file with path. Please can anyone tell me where is that Bash... (5 Replies)
Discussion started by: gwgreen1
5 Replies

6. Shell Programming and Scripting

Sed -f alternatives?

I have a list of items (control file) that I want to substitute in a text file, and it's BIG. The file has two items, the original, and the new: A B B C D E The file has something like 10,000 entries. So in the oldfile.txt, I'd like to basically make all these expression matched... (9 Replies)
Discussion started by: twoblink
9 Replies

7. UNIX for Advanced & Expert Users

SSH alternatives

Hi, I am using SSH to execute unix commands on remote machines. But, SSH will be diabled soon and I am looking for other alternatives to execute remote scripts/commands, without SSH . any suggestions or workarounds with out SSH for remote program executions ? Thanks in advance. (4 Replies)
Discussion started by: talashil
4 Replies

8. Shell Programming and Scripting

Alternatives to Expect

Are there any other alternatives to using Expect script? Can functionality provided by Expect be achieved by any other scripting language? (7 Replies)
Discussion started by: indianya
7 Replies

9. UNIX for Dummies Questions & Answers

Find command alternatives

Hi is there an alternative other than the find command to get the size of files which are 10 days older ? I already use a script with find command find . -mtime +10. However would want to have an alternative script to find the size of files which are over 10 days. Let me know if you... (1 Reply)
Discussion started by: venkidhadha
1 Replies

10. UNIX for Dummies Questions & Answers

Typeset builtin error

I'm attempting to emulate another users .zshrc file. However, I'm sort of confused on what exactly the -g argument does for the typeset builtin. Here's what he has in his .zshrc file: typeset -ga sources sources+="$ZSH_CONFIG/environment.zsh" sources+="$ZSH_CONFIG/options.zsh"... (4 Replies)
Discussion started by: brandontdr
4 Replies
ikvm(1) 						      General Commands Manual							   ikvm(1)

NAME
ikvmc - compile java classes and jars into CIL assemblies SYNOPOSIS
ikvmc [ -options ] class | jar ... DESCRIPTION
IKVM is an implentation of the Java for the Common Language Infrastructure (CLI) runtime. It includes a byte code JIT compiler/verifier to translate Java byte code to CIL and GNU Classpath to provide the Java class libraries. ikvmc allows statically compiling of Java bytecodes in Java classes and jars into CIL assemblies. The ikvm(1) program provides dynamic compilation to CIL and execution. The Java class or jar parameters may be file globs such as *.class and used to process multiple sources in one step. Duplicates specified in processing will be ignored, with a warning given. OPTIONS
-Dname=value Set system property name to value at runtime. -apartment:mta Apply MTAThreadAttribute to the main class. -apartment:none Don't apply STAThreadAttribute to the main class. -apartment:sta (default) Apply STAThreadAttribute to the main class. -assembly:assembly-name Specify the generated assembly name to assembly-name If this option is omitted, the assembly name is usually the output filename. -da[:packagename ... | :classname] Set the system property to disable assertions. -debug Generate debugging info in the output file. Only useful if the source class files contained debug information, such as compiled with the javac -g option. -disableassertions[:packagename ... | :classname] Set the system property to disable assertions. -ea[:packagename ... | :classname] Set the system property to enable assertions. -enableassertions[:packagename ... | :classname] Set the system property to enable assertions. -exclude:filename Use the list of classes in filename to exclude from compiling. -key:keycontainer Use the key in the container keycontainer to sign the assembly. -keyfile:keyfilename Use the key in file keyfilename to sign the assembly. -main:mainclass Specify the main method class mainclass contains the main method. If omitted and the target is an executable, a search is done for a qualifying main method and ikvmc reports if it is found. -noglobbing Do not glob the class or jar arguments. -nojni Do not generate a JNI stub for native methods. -nostacktraceinfo Do not create metadata to emit rich stack traces. -opt:fields Remove unused private fields. -out:outputfile Set the output filename to outputfile. The extension used here must match the -target used. For a library, it must end in .dll and for an exe or winexe, it must end in .exe. If this option is omitted, an output name will be chosen based on the target type and the name of the input files. If the input files were given with globs, this option must be used. -recurse:filespec Process all files and directories matching filespec which can use globbing. -r:library-filespec -reference:library-filespec Reference an assembly library-filespec used from Java. This option can be used multiple times and globbing is allowed. -resource:name=path Include a Java resource named name in file path. -srcpath:path Set the location of source code for debugging to path. The name of a package is appended to the path to find the file. -target:exe -target:library -target:winexe -target:module Set the generated target type to either a console executable (exe) generating a result.exe, library (library) generating a result.dll, windows executable for GUI applications (winexe) generating a result.exe or module for use by the linker (module) gener- ating a result.netmodule. winexe is only used on Windows. -Xmethodtrace:method-name Build tracing into the specified output method method-name. -Xtrace:name Displays all tracepoints with the given name name. -version:M.m.b.r Set the assembly version to M.m.b.r. SEE ALSO
ikvm(1), ikvmstub(1). IKVM Project web site http://ikvm.net/ <http://ikvm.net/> Man page by Dave Beckett, made available under the same terms as IKVM. 2005-06-19 ikvm(1)
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy