Questions tagged [ksh]

Ksh is the executable name for the Korn shell developed by David Korn at AT&T Laboratories in the early 1980s. It is commonly used in Solaris and is favored for its ability to use Emacs and Vi shortcuts at the command line.

58 questions
0
votes
1 answer

ksh + print the last value from parameter ( as $_ in perl)

I need advice - how to print the same last value in ksh scripts without to print param argument for example in perl last value is $_ , but we not have this option in ksh script example - of ksh script function test { ETH_PORT=eth0 echo…
Eytan
  • 611
  • 6
  • 13
  • 27
0
votes
2 answers

svn: Too many arguments to import command

Having a problem with the --message flag to the svn import command. On some servers it works, but on others it gets confused if the message contains spaces, even if you single or double quote the message string thus: svn import -m 'New stuff…
RCross
  • 469
  • 2
  • 6
  • 19
0
votes
1 answer

linux + run script on other shell because script stuck - not return to linux prompt

In my Linux machine I have binary script (called transferNames.bin ) The problem is that when I run transferNames.bin with & script stuck and not returns to Linux prompt “#”, even if I wait 1 day or more ( so I cant continue work on my Linux because…
Eytan
  • 611
  • 6
  • 13
  • 27
0
votes
0 answers

how to make a shell execute with suid

I'm trying to suid a shell and it's not working. I need help understanding why, and how to fix it... I'm following these steps (as root) cp /usr/bin/bash /usr/bin/bash-emergency chmod 4755 /usr/bin/bash-emergency bash-emergency is owned by…
mikem
  • 418
  • 2
  • 7
-1
votes
2 answers

linux/solaris insert date & time at the beginning of each line in file

I want to add date & time at the begging of each line in some file I used sed in order to add the date & time before each line in file please advice what I need to update in my sed in order to support this action , I can accept other solution with…
yael
  • 2,433
  • 5
  • 31
  • 43
-1
votes
2 answers

shell: create Shortcut command (alias or function) for working with IP address as arguments

I am not sure if I performed the following illegal or true but what I need is - to create set of ready commands so if I need to use , for example to match IP address with 4 octet I can use the command - command_that_match_four_octet Please advice…
yael
  • 2,433
  • 5
  • 31
  • 43
-1
votes
1 answer

linux + print message on the screen after login to linux machine

I have linux machine red-hat 5.1 I want to write ksh/bash script that perform the following Each time that someone login to the linux machine then he will get the following message on the screen - after entering login/password PLEASE DONT DO…
yael
  • 2,433
  • 5
  • 31
  • 43
-1
votes
3 answers

linux + generate new file with specific structure from text file what the best option

in my Linux machine I have the file orig-file.txt this file include now 4 fields but they could be less or more ( this file generate by other application ) I need advice - what the best option to translate the orig-file.txt to file as…
yael
  • 2,433
  • 5
  • 31
  • 43
-2
votes
1 answer

Execution "df" command on AIX with the bash

it's very strange that when I am executing df command on AIX with bash like  bash -c "df /" I suppose it will be executed like on Linux, but still the result is same like korn shell. Please give me explanation to this. How can I somehow to be sure…
-2
votes
1 answer

case + how to implement equal or less or greater in case syntax

my target is to verify the range of number with (only with - case + esac ) , and print the range so for example if number is between 0-80 , case will print >=0<=80 or if range is between 81-100 then case will print >=81<=100 and so…
yael
  • 2,433
  • 5
  • 31
  • 43
-3
votes
2 answers

perl one liners + add empty line after the last line

please advice what need to change in the perl syntax in order to add new empty line after the last line? example IP_INFO=12.23.2.1 echo IP= | perl -pe "s/$/$IP_INFO/" 1>>file . more file IP=12.23.2.1 <-- last line
yael
  • 2,433
  • 5
  • 31
  • 43
-3
votes
1 answer

linux + count how many digits in IP address

I write the following syntax (exist in my ksh script) in order to find how many digits I have in IP address IP_address=127.1.1.1 echo $IP_address | sed s'/\./ /g' | wc | awk '{print $2}' 4 . IP_address=127.1.1 echo $IP_address | sed s'/\./ /g' |…
yael
  • 2,433
  • 5
  • 31
  • 43
-3
votes
2 answers

linux + solaris + delete all characters in file except numbers and dot char

please advice how to delete all characters in file except numbers and "." Should be implemented by sed or awk or perl ( one line ) or any other idea , so I will add the syntax in my ksh script remark - the solution must be according to the…
yael
  • 2,433
  • 5
  • 31
  • 43
1 2 3
4