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
nice(1) 							   User Commands							   nice(1)

NAME
nice - invoke a command with an altered scheduling priority SYNOPSIS
/usr/bin/nice [-increment | -n increment] command [argument]... /usr/xpg4/bin/nice [-increment | -n increment] command [argument]... csh Builtin nice [-increment | +increment] [command] DESCRIPTION
The nice utility invokes command, requesting that it be run with a different system scheduling priority. The priocntl(1) command is a more general interface to scheduler functions. The invoking process (generally the user's shell) must be in a scheduling class that supports nice. If the C shell (see csh(1)) is used, the full path of the command must be specified. Otherwise, the csh built-in version of nice will be invoked. See csh Builtin below. /usr/bin/nice If nice executes commands with arguments, it uses the default shell /usr/bin/sh (see sh(1)). /usr/xpg4/bin/nice If nice executes commands with arguments, it uses /usr/xpg4/bin/sh (see ksh(1)). csh Builtin nice is also a csh built-in command with behavior different from the utility versions. See csh(1) for description. OPTIONS
The following options are supported: -increment | -n increment increment is a positive or negative decimal integer that has the same effect on the execution of the utility as if the utility had called the nice() function with the numeric value of the increment option-argument. See nice(2). nice() errors, other than EINVAL, are ignored. If not specified, an increment of 10 is assumed. The super-user may run commands with priority higher than normal by using a negative increment such as -10. A negative increment assigned by an unprivileged user is ignored. OPERANDS
The following operands are supported: command The name of a command that is to be invoked. If command names any of the special built-in utilities (see shell_builtins(1)), the results are undefined. argument Any string to be supplied as an argument when invoking command. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of nice: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, PATH, and NLSPATH. EXIT STATUS
If command is invoked, the exit status of nice will be the exit status of command. Otherwise, nice will exit with one of the following val- ues: 1-125 An error occurred. 126 command was found but could not be invoked. 127 command could not be found. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/nice +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ /usr/xpg4/bin/nice +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), nohup(1), priocntl(1), sh(1), shell_builtins(1), nice(2), attributes(5), environ(5), standards(5) SunOS 5.11 23 Jan 2004 nice(1)
All times are GMT -4. The time now is 10:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy