I want to learn about variables or different command lines using man (man) command, but i can't - terminal

I am using hyper termianl in my windows laptop and i don't know how to use ( man ) command which is manual for learning about variables.
Please tell me if there is any different command for manual or learning about variables
I tried to learn about (echo ) command using (man) but my terminal telling me
BASH: man is not defined ;

Related

How to print from Git Bash terminal?

While using git bash terminal, I can't print a pdf file. In fact I can't print anything. I am using correct file name and I've tried typing:
lp file.pdf
but I get bash:
lp: command not found
I get same promt when trying to print anything using lp command.
How do you print from git bash terminal?
Git bash is an emulated bash. The standard programs available on most Linux distributions are not available there.
Windows programs are available. You can run them, but you'll have to make sure all the details are set up, and sometimes they don't like the environment.
For example, both notepad and wordpad (write) should be able to use the /p and/or /pt options, but you may have trouble getting it to find the file.
write tst
will open the file in wordpad, and
write /p tst
is supposed to print it, assumedly to the default printer, though my config seems admin-locked to something stupid.
Maybe that will help. Good luck.

How would I interface with the Linux terminal (bash for windows) using windows command prompt?

I just recently found out about using bash in windows. I had alot of fun installing linux programs onto my windows computer using bash and wondered how I would be able to run an automatic script so I dont have to export my display everytime I open bash.
I used to write scripts for cmd called batch scripting and I would be able to do everything cmd could do. Now that I have access to bash, I want to script a program that connects useful pieces of cmd with useful pieces of bash but I Can't find any results telling me how to call bash commands from cmd. Thank you - Zak Kaioken

Running a .bat script under Cygwin bash

I would like to use an existing DOS/Windows .bat script under a Cygwin bash shell. The .bat script creates a number of variables which need to exist after the .bat script ends.
This works, but the variables are not retained.
$ ./.phs_project_setup.bat .
It appears that this does not extend to sourcing a .bat script so that the variables it creates still exist in the environment.
$ . ./.phs_project_setup.bat .
-bash: #ECHO: command not found
-bash: SET: command not found
-bash: $'\r': command not found
-bash: REM: command not found
Any ideas on overcoming this obstacle?
What I have done is written the environment to a file, then iterated over the file using 'cygpath -u' on each value. Perhaps I have missed some, but it appears that cygpath will only change something that actually looks like a path. It does not change Oracle connect string for example; "user/pass#DB". I added 'export ' to the beginning of each line so that it can be sourced into a bash shell. It is not one step yet, but better.
Remember that Unix systems are generally case sensitive. cygwin's bash can run windows executables directly, but it's STILL case senstive. SET is not a valid bash command, while set is.
You can force it to source the file and try and run it, but it'll only be able to run shell built-in commands which have a 1:1 name correspondence to cmd commands. So set works, but #echo won't, because # means nothing to bash. Same goes for rem.
I would suggest trying to run the batch script using the batch interpreter (aka the COMSPEC environment variable, which is simply CMD) and then echoing out the environment it has set up as presented in this question: How I can use PowerShell with the Visual Studio Command Prompt?
You can then try and set up the environment in a similar fashion. Note that you may have a problem with the direction of slashes, drive names and other stuff like that
Sounds like you need to run the batch file and then start cygwin. If so, call the batch file from whatever file you use (cygwin.bat for example) to start cygwin. Then the variables should be available.
Alternatively, I've also moved the required bits into the proper unix configuration files to achieve the same results.

How can I run a shell command ( written in Vim ) using Ipython? [duplicate]

Is there a way to use "magic commands" from IPython from an outside file? For example if I have a file, "rcode.py" with the code:
%load_ext rmagic
%R a=c(1,2,3);b=c(2,3,4);print(summary(lm(a~b)))
This gives me a SyntaxError for the first line when I run it using ipython rcode.py in the command line. However when I type these lines straight into the interactive shell with ipython it runs fine. Is this because you only do magic in the interactive shell?
Thanks!
If you name your file with a .ipy extension, ipython will parse it properly. You can simply make a symlink if you want:
$ ln -s rcode.py rcode.ipy
$ ipython rcode.ipy

Need to write a program to sanely configure a login shell

I just started using a Solaris 10 (Sparc) box where I telnet in and get confronted with a very unfriendly interface (compared to the standard bash shell I use in cygwin or linux) --- the arrow keys do not work as I expect them to. Being an NIS system, changing the shell is not as easy as using the "chsh" command. And setting the SHELL environment variable in ~/.login and ~/.profile is not working for me. So I'm thinking that I may need to write a script to determine if bash is running the script and starting bash if the answer is no. My first attempt, trying to invoke /bin/bash from ~/.profile seems to work but kind of doesn't feel right. Other suggestions? And how do I tell programmatically which shell is actually executing?
You can tell what shell is running with echo $0. For example:
$ echo $0
-bash
If you're changing shell you probably want to replace the current shell process rather than be a child of it, so use exec.
Also, you want to pass bash the -l flag so it acts as if it has been called as part of the login process.
So you'll want something like:
exec bash -l
You are probably running with ksh(1) on Solaris. You have several options, read the manpage for ksh and configure it or install another shell you're more familiar with like bash. I'd personnaly recommend zsh.

Resources