Greetz all,
I'm using OBSD 2.9 with /bin/sh as my shell. I want to modify the SH prompt to reflect my current working directory.
I'm new to shell programming, so pardon if I'm going about things wrong ;)
I thought I'd be able to do it with the following line:
PS1="`pwd`# "
but of course,... (9 Replies)
Hello there !
I am new in this Unix world and just start learning Unix. I have very simple question about changing PS1 variable (Shell Prompt)
i have local.profile file in my working directory, i open in vi edit mode and add this line PS1="Hello:>" and i save that file.
I disconnected from... (2 Replies)
HI ,
In the below script I am trying to return the value of the environment variable TIBCO_HOME to the caller
#! /usr/bin/csh
set VAR_NAME=$1
echo VAR_NAME
On the aix console.. set to setenv TIBCO_HOME /app/tibco
When I execute the script... myscript.sh TIBCO_HOME, the script... (5 Replies)
I know many will probably say go read some tutorials...I would like to say that I am. However, I need to know this for work and it needs to be done soon.
In my script I have a while loop that reads a .tbl file of 4 columns and assigns them to variables a, b, c, d.
Once in the loop i do
... (10 Replies)
Give the code:
set line = 2
set year = `sed -n '2p' file
while ($line < 500)
echo $line > f.txt
@ line = $line + 1
end
How do I utilize the variable $line in the code instead of the number 2. I'm using this in a while loop and counter. I've tried quoting it, double/single... (1 Reply)
Hello, I have a simple(I think) question!
Although simple, I have been unable to resolve it, so I hope someone can help! OK, here it is:
1)I have an awk script that prints something, such as:
awk '{print $2}' a > x
so x might hold the value of say '10'
2)Now, I just want to check to see if... (4 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
Hi
what i want:
listing files in a special range
ls -lrt 20120601{05..06}*
...
-rw-rw-r-- 1 imp imp 279 1. Jun 07:51 201206010550
-rw-rw-r-- 1 imp imp 279 1. Jun 07:01 201206010600
-rw-rw-r-- 1 imp imp 279 1. Jun 07:11 201206010610
-rw-rw-r-- 1 imp imp 279 1. Jun 07:21... (1 Reply)
Hi Gurus,
Not able to catch what's going wrong here. I just want to get output as "tree".
server:/mk/app/nexapp $ echo $SHELL
/usr/bin/ksh
server:/mk/app/nexapp $ export db_name1="tree"
server:/mk/app/nexapp $ export i=1
1st try:
server:/mk/app/nexapp $ echo $(db_name$i)
ksh: db_name1: ... (3 Replies)
Hi all...
Well I have not been inactive but working out how to make OSX 10.14.x command line audio player have a variable sample rate.
This is a back door as afplay does not have a sample rate flag unlike aplay for ALSA, in Linux flavours.
This is a DEMO only but a derivative of it will... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT PHP
shift
shift(1) User Commands shift(1)NAME
shift - shell built-in function to traverse either a shell's argument list or a list of field-separated words
SYNOPSIS
sh
shift [n]
csh
shift [variable]
ksh
* shift [n]
DESCRIPTION
sh
The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is assumed to be 1.
csh
The components of argv, or variable, if supplied, are shifted to the left, discarding the first component. It is an error for the variable
not to be set or to have a null value.
ksh
The positional parameters from $n+1 $n+1 ... are renamed $1 ..., default n is 1. The parameter n can be any arithmetic expression that
evaluates to a non-negative number less than or equal to $#.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), ksh(1), sh(1), attributes(5)SunOS 5.10 15 Apr 1994 shift(1)