Sponsored Content
Full Discussion: Convert a bash to ash
Operating Systems Linux Ubuntu Convert a bash to ash Post 302936520 by Scrutinizer on Thursday 26th of February 2015 06:11:09 AM
Old 02-26-2015
That looks a bit garbled, this should be:
Code:
[ ! -z "$PS1" ]

Note the spaces around the brackets...

which is equivalent to
Code:
[ -n "$PS1" ]

or
Code:
[ "$PS1" ]

But the logical counterpart of [ ! -t 0 ] would be [ -z "$PS1" ]

However,
Code:
[ ! -t 0 ]

is part of Posix so this should just work in ash. So I do not think this is a bash vs. ash matter.
If it does not work in a certain application, then it should also not work in the case of bash, unless your ash version has a bug...

Last edited by Scrutinizer; 02-26-2015 at 09:39 AM..
This User Gave Thanks to Scrutinizer For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert bash to sh URGENT :(

Hi, I have to write a program to compare 2 files for copying. the program is ran on Solaris 5.8 like this: script.sh file1.txt file2.txt I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I... (2 Replies)
Discussion started by: Chris Jones
2 Replies

2. Shell Programming and Scripting

Why generate "ash and bash" different output for same bash script?

Hi, For my bash script, terminal with bash is generate an OK output and program works right. already, terminal with ash have "line 48: syntax error: Bad substitution" output and program don't work. :confused: (0 Replies)
Discussion started by: s. murat
0 Replies

3. Shell Programming and Scripting

***convert from perl to bash***

can any body translate the follwing script into one that works in bash? #!/usr/bin/perl # classify_books.pl my $csv_file = shift; my %categories = ( 'childrens' => 'childrens_books.txt', 'horror' => 'horror_books.txt', 'sports ' =>... (3 Replies)
Discussion started by: ferrycorsten73
3 Replies

4. UNIX for Dummies Questions & Answers

Differences in BASH and ASH shells regarding if command?

Guys I now have a script that's working in a BASH environment, however one line doesn't appear to be working on an embedded device that has a busybox therefore ASH shell. I've googled but there's very little I can find regarding the ASH shell. In BASH the following line works... if ] ;... (6 Replies)
Discussion started by: Bashingaway
6 Replies

5. Programming

Convert Bash script to C

dear all, i need your advice for convert bash shell to C programming INDEX=/zpool1/NFS/INDEX/${1} SCRIPT=/zpool1/NFS/script/${1} LIST=SAMPLE cd ${SCRIPT} for i in `cat ${LIST}` do GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'` /usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (2 Replies)
Discussion started by: zvtral
2 Replies

6. Shell Programming and Scripting

Bash Script to Ash (busybox) - Beginner

Hi All, I have a script that I wrote on a bash shell, I use it to sort files from a directory into various other directories. I have an variable set, which is an array of strings, I then check each file against the array and if it is in there the script sorts it into the correct folder. But... (5 Replies)
Discussion started by: sgtbobie
5 Replies

7. Ubuntu

Bash to Ash, errors and adjustments

I wrote Bash script and now I want to convert it to Ash. One headache is this function: do_adduser() { setaddprompt _arr_add=("Add manually" "Add via TXT" "return to main menu" "exit program") select add_action in "${_arr_add}" do case "$REPLY" in 1)... (7 Replies)
Discussion started by: fzivkovi
7 Replies

8. Ubuntu

Bash to ash port, character-matching problem

I'm trying to convert this working bash script into an Ash script, read -p "Username:" _username if ! ]]; then echo "Valid" else echo "INVALID" fi However, Ash does not recognize the "=~" character. How can I do this? Also, is there a good reference guide, so I... (5 Replies)
Discussion started by: fzivkovi
5 Replies

9. Shell Programming and Scripting

Bash to convert to m-d-yyyy

I am using bash that when run downloads a file a verifies that there is data in it. What I am not able to do is have a user enter a date in any format they wish and have it converted to m-d-yyyy. Thank you :). Bash printf " Welcome to NGS analysis, checking for new files and creating a... (2 Replies)
Discussion started by: cmccabe
2 Replies
filezilla(1)							 FileZilla Manual						      filezilla(1)

NAME
FileZilla - FTP client SYNOPSIS
filezilla filezilla [-l <logontype>] <FTP URL> filezilla -h|-s|-v filezilla -c <site> DESCRIPTION
FileZilla is a powerful client for plain FTP, FTP over SSL/TLS (FTPS) and the SSH File Transfer Protocol (SFTP). OPTIONS
-c <site>, --site <site> Connect to the given site from the Site Manager. Site has to be given as complete path, with a slash as separation character. Any slash or backslash that is part of a segment has to be escaped with a backslash. Path has to be prefixed with 0 for user defined entries or 1 for default entries. Site path may not contain double quotation marks. Example: filezilla -c 0/foo/bar/sl/ash connects to the user site sl/ash in the site directory foo/bar May not be used together with -s nor with URL parameter. -h, --help Displays a help dialog listing these commandline options. -l <logontype>, --logontype <logontype> Set a special logontype, can only be used in combination with a FTP URL as argument. Logontype has to be either ask or interactive. If -l isn't given, the normal logontype is used. -s, --sitemanager Start with Site Manager opened. May not be used together with -c nor with URL parameter. -v, --version Display version number of FileZilla. ENVIRONMENT
The FZ_DATADIR environment variable can be used to specify the directory containing FileZilla's data files. SUPPORT
Please visit http://filezilla-project.org/ for further information. Report bugs only if you are using the latest version available from the FileZilla website. COPYRIGHT
Copyright (C) 2004-2010 Tim Kosse FileZilla is distributed under the terms of the GNU General Public License version 2 or later. SEE ALSO
fzdefaults.xml(5) April 2008 filezilla(1)
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy