Sponsored Content
Top Forums Shell Programming and Scripting Files test How to recover a specific variable Post 302981918 by rovf on Wednesday 21st of September 2016 08:27:17 AM
Old 09-21-2016
Quote:
Originally Posted by Arnaudh78
Thank for your reply, I use #!/bin/bash, So I work in Bash ? I'm beginner, I'm open at all.what do you recommend?
This depends on how you invoke your script.

If the script as executable rights, and you invoke it by typing the script name, the #! line defines, which language processor will be used to run your script. In your case, it is the bash executable stored in the /bin directory.

Alternatively, you can invoke the language processor to be used explicitly from the command line. For instance, if I write bash myfile, the file myfile should better be a bash script (and not zsh or ksh or awk....), as it will be executed under bash. The same applies to other languages - zsh, perl, ruby, ....

Now as for the recommendation. It is difficult to give a recommendation without starting a language war, because most programmers seem to be very picky when it comes to choosing one language over another, and everyone has his favorite pet, so note that I give here only my personal opinion, and others might advice you differently.

As for shell programming, after having had long experience with bash and a little bit experience with ksh, csh and tcsh, I turned to zsh, because I found that quite a few things are simpler to do in zsh than in the other languages. I yet have to see something which is easier to do in bash than in zsh (there must be something). The main drawback of zsh is that fewer people use it, so if you get stuck, you might have to search longer for someone to help. However, I got every zsh question answered by someone so far.

As second language, I tend to use Ruby (after having collected experience with awk, Perl, Python and Tcl), because I found it more expressive than the others and much easier to learn.

Of course one thing to consider it, where your script will run, and how much control you have on the software at the target machine. If I know that there is no zsh installed on the target machine, and I don't even have an account there, it would not be wise to deliver a zsh script. Having said this, even when using bash, you should make sure that you either develop your scripts with the same bash version than the one available on the target host, or write your scripts in a way that they will likely run under each version. This might turn out to be difficult, in particular for someone who doesn't have much experience yet.

If you run your programs only on your own machine, it is up to you what tools you choose.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Recover deleted files

Is there a Unix tool, like in Novell, to recover accidentally deleted files? (2 Replies)
Discussion started by: kuultak
2 Replies

2. AIX

recover deleted files

How to recover deleted files in AIX ? (1 Reply)
Discussion started by: vjm
1 Replies

3. UNIX for Dummies Questions & Answers

How to test for a specific file size

Hello, In my shell program, I need to test for a specific size of a text file before it can be imported into an oracle table. If the size is less than that number, my program should stop processing. What is the correct command to do this test? Thanks! (1 Reply)
Discussion started by: GEBRAUN
1 Replies

4. Shell Programming and Scripting

Is there a way to recover files deleted using rm command???

Hi All, I just mistakingly deleted some files using rm command.Is there a way to get it back?i work on Solaris 10 Thanks, Kumar (1 Reply)
Discussion started by: kumarsaravana_s
1 Replies

5. UNIX for Dummies Questions & Answers

Recover data from 2 files then combine

Using dd or similar tools to recover data from 2 damaged cdroms, I need a way to then combine the 2 files, 1 from each cd, and make a good file: this all result from finding that certain cd's tops scratch easily even when using the "proper" cd markers, hence making the file useless, however the... (1 Reply)
Discussion started by: saint65
1 Replies

6. UNIX for Dummies Questions & Answers

how to recover deleted files in unix

Hi Experts, by mistake i deleted some files that are very important to the project. is there any way that i can recover those files,there is no backup for that but the details of the file we know. This will be a great help. Thanks (5 Replies)
Discussion started by: namishtiwari
5 Replies

7. UNIX for Dummies Questions & Answers

Recover directory/files in unix

Hi Guys I accidently deleted a directory( and the files in it) in unix using 'rm -rf' :) Is there any procedure/script/command to recover the same? Your help is highly apperciated -thanks Subramanya (1 Reply)
Discussion started by: sgbhat
1 Replies

8. Shell Programming and Scripting

Need to Recover Deleted Files

Hi, By mistake, executed the following command : rm -rf * and ALL files got deleted. But I need to get back these files as they are very very important. Please help me how to recover this file. Its Urgent for me please. Thanks in advance. (6 Replies)
Discussion started by: unx100
6 Replies
fizsh(1)							       fizsh								  fizsh(1)

NAME
fizsh - friendly interactive zshell. SYNOPSIS
fizsh [OPTIONS]... [ARGUMENTS]... DESCRIPTION
Fizsh is a front end to zsh. Fizsh provides zsh with interactive syntax-highlighting and a MATLAB-like history-search. Fizsh is intended to look and feel similar to fish. A distinguishing feature is that fizsh can handle Bourne compatible syntax. This is because fizsh is a front end to zsh. Fish uses its own syntax. CONFIGURATION
$HOME/.fizsh is the directory where fizsh keeps its configuration files. The file $HOME/.fizsh/.fizshrc serves as the user's local startup script. Local customizations, such as aliases and functions, can be added here. $HOME/.fizsh/.fizshrc allows the same syntax as $HOME/.zshrc under zsh. $HOME/.fizsh/.fizsh_history is default name of fizsh's history file. The other files in $HOME/.fizsh are installed by /usr/bin/fizsh. In order to reinstall these files use: /usr/bin/fizsh -r or /usr/bin/fizsh --reinstall. Compared to the default configuration of zsh, fizsh additionally sets the options "histignorealldups", "histignorespace", "histreduceblanks", "incappendhistory", "interactivecomments", "promptsubst", "correct" and "nobeep". For further configuration details consult zsh's man pages. INVOCATION
Fizsh is meant to be invoked without options and without command-line arguments. The only supported command-line options are "--version", "--help", "--login", "--reinstall", "-v", "-h", "-l" and "-r". "--version" or "-v" yields fizsh's version number. "--help" or "-h" causes fizsh to print brief usage information. "--login" or "-l" cause fizsh to be a login shell. "--reinstall" or "-r" will reinstall some of fizsh's configuration files (see above). If invoked with other command-line options and/or arguments fizsh will silently revert to zsh. BUGS
There are no known bugs at the moment. Bug reports, bug fixes and other comments are welcome. NOTES
MATLAB is a registered trademark of The MathWorks, Inc. AUTHOR
Written by Guido van Steen, based on work by the "zsh-syntax-highlighting contributors" and the contributors to "zsh-history-substring- search". SEE ALSO
zsh(1) fish(1) Version 1.0.2 9 Aug 2011 fizsh(1)
All times are GMT -4. The time now is 03:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy