Tag Archives: UNIX

How to split big file on HP-UX and join on Windows?

By prvnrk

Hi HP-admins,

I have 120GB file on HP-UX and need to split to 4GB pieces and join them on Windows.

As I don’t want to use zipsplit, tried to use split command and join on windows using “copy /b” but it doesn’t work (It merges and creates new file but file is corrupt)

What is the correct way to join UNIX split files on Windows? ( “copy /b” not working correctly)

Or is there solution for it?

Thanks

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

How to use MAIL command in UNIX?

By harika03

Hello All,

I have an issue where I have to send multiple filenames(only names of the file) through an email and I have to send in a single mail.

For example…Kscik.lk.txt_$currentdate,kscik_ii.txt_$currentdate. I can send it as below

echo “files n Kscik.lk.txt_$currentdate n kscik_ii.txt_$currentdate are available in so n so folder” | mailx -m -s x@g.com.

The above syntax can only send the subject that has two files but I have to send an single email where subject contains all starting with kscik* related files.

Please help on this..

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Use of commands of analyze and elaborate in design compiler

By Paromita

Hi I am trying to read a verilog code into the design compiler and I am using the following commands but I am getting an error.

Code:

analyze -format verilog -lib WORK dff_sync_reset.v
Error: *** Presto compilation terminated with 1 errors. ***
elaborate dff_reset_sync –arch “verilog” –lib WORK

Error: Error: Can't find the architecture 'dff_reset_sync(verilog)' in the library 'WORK'
0


I am getting these errors so I think the file is not linked to UNIX. Can you please tell me if I am doing anything wrong.

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Calling Macros in UNIX command

By Kalaiselvi66

Hi ..

I have created a sql macro, i want to execute this through ksh in putty.ie) sql.ksh will contain the macro query ,once i call this ksh ,the macro should trigger.

I am able to write a macro : for ex:

create macro macro_name
(sel * from db_tablename)
execute macro_name.

Could anyone explain me how to add the above command in a ksh shell script ..i tried by
.logon username/pwd like this…..

but i am not able to…

Thanks in advance

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Script to change the file at one go on different UNIX machines

By tuntun27272727

Hi Folks ,

I have a query that is I have a server (unix machhine) to which I login thru winscp or putty , mostly I use putty and at a particular location there is one xml(abc.xml) while which I change , let say

Code:

1) I login to first unix box
hostname :- ccc74
username :-bbb
passwd :- ccc

and the location on unix box machine is
/opt/app/al/servers/abc.xml


similiarly there are several unix box machines having hostnames…ccc75, ddd 75, eee76 , fff77 , ggg78 and at the same location there is abc.xml

Now please advise me any script , as rite now I login thru winscp and do the changes manually on each xml , please advise any script:eek:

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Removing the sas comment line using UNIX

By saaisiva

I have tried a lot, Need your help guys.

SAS Program:

data one ; /* Data step */
Input name $; /*Dec variables*/

I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and get the output as shown below.
Output :
data one ;
Input name $;

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Remove SAS comments using UNIX

By saaisiva

I have tried a lot, Need your help guys.

SAS Program:

data one ; /* Data step */
Input name $; /*Dec variables*/

I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and get the output as shown below.
Output :
data one ;
Input name $;

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

How to Change the % prompt to – prompt in UNIX?

By manjiri sawant

how to Change the % prompt to – prompt in unix

:wall:

———- Post updated at 07:40 AM ———- Previous update was at 07:38 AM ———-

How To display the last modification time of any file in unix

———- Post updated at 07:40 AM ———- Previous update was at 07:40 AM ———-

How to display the contents of any file on the VDU in unix

:wall:

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Looping with wait in UNIX

By Pratik4891

Hello Gurus ,

Could you help me with my below requirement

In my script I will start a process ,it takes some time to complete the process.After completion it will create a file
after that I have to restart the process again
The number of time it will be done will vary but that count we should know before

so here is the algorithm

for in 1…count

delete indicator file

step 1 start process
step 2 check indicator file exist [ denotes process completed ]
no then sleep for 30 second
go to step 2
else
go to step 1 [run the process again ]

do this until the for loop completed

Could anyone please give me the code or suggestion how to procees
Your help is very much appreciated

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Samba share show folders but not it's files

By josseossa

Hello,
I’m working in AIX 6.1, i’ve installed samba and i managed myself to share a folder and be able to write a read from windows. i tried to log the machine in the domain, but i couldn’t, the machine appeared in the domain but in the UNIX it show a message that the operation was failed. Now the last useful configuration as standalone server doesn’t work.
This is mi smb.conf file:

Code:

# Samba config file created using SWAT
# from 10.18.1.43 (10.18.1.43)
# Date: 2013/07/16 16:00:56

[global]
workgroup = XXXXXX
security = SHARE
passdb backend = tdbsam
guest account = sambapru
log level = 3
log file = /var/log/samba/log.%m
max log size = 50
load printers = No

[public]
comment = Public Stuff
path = /XXXXXX/pruebas31
force user = sambapru
force group = staff
read only = No
guest ok = Yes


I checked the users prmissions on share and they’re ok, this are the permissions on shared folder:

Code:

root@YYYYYY:/> ls -dltr /psreports/pruebas31
drwxrwxr-x 5 sambapru staff 256 Jul 16 15:04 /XXXXXXX/pruebas31


and this is the error log when i establish a new connection to share from windows:

Code:

[2013/07/16 15:01:45, 3] smbd/process.c:process_smb(1110)
Transaction 1 of length 137
[2013/07/16 15:01:45, 3] smbd/process.c:switch_message(914)
switch message SMBnegprot (pid 618634) conn 0x0
[2013/07/16 15:01:45, 3] smbd/sec_ctx.c:set_sec_ctx(241)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [PC NETWORK PROGRAM 1.0]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [LANMAN1.0]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [Windows for Workgroups 3.1a]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [LM1.2X002]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [LANMAN2.1]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(508)
Requested protocol [NT LM 0.12]
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_nt1(360)
not using SPNEGO
[2013/07/16 15:01:45, 3] smbd/negprot.c:reply_negprot(609)
Selected protocol NT LM 0.12
[2013/07/16 15:01:45, 3] smbd/process.c:process_smb(1110)
Transaction 2 of length 246
[2013/07/16 15:01:45, 3] smbd/process.c:switch_message(914)
switch message SMBsesssetupX (pid 618634) conn 0x0
[2013/07/16 15:01:45, 3] smbd/sec_ctx.c:set_sec_ctx(241)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2013/07/16 15:01:45, 3] ...read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Sort based on Multiple Columns in UNIX

By DevendraG

Hi,

I would like to sort a list in different ways:

1> Unique based on Field 1 with highest Field 4

For Instance Input:
1678923450;11112222333344;11-1x;2_File.xml
1678923450;11112222333344;11-1x;5_File.xml
1234567890;11113333222244;11-1x;3_File.xml

Output:
1234567890;11113333222244;11-1x;3_File.xml
1678923450;11112222333344;11-1x;5_File.xml

2> Unique based on Field 2, then Field 1 with highest Field 4

For Instance Input:
1234567890;11113333222244;11-1x;3_File.xml
1234567890;11112222333344;11-1x;1_File.xml
1678923450;11112222333344;11-1x;2_File.xml

Output:
1234567890;11112222333344;11-1x;1_File.xml
1678923450;11112222333344;11-1x;2_File.xml
1234567890;11113333222244;11-1x;3_File.xml

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Simply question about capturing output to /dev/tty

By Paul R

Suppose another person wrote the following one-line shell script:

echo $RANDOM > /dev/tty

QUESTION #1: How can the random number, which is output to the terminal by this script, be captured in a variable?

QUESTION #2: How can this be done in a cron job?

Specific code, whether in ksh or C, would be greatly appreciated.

———————————————————————

REAL LIFE STORY: We use software with concurrent licenses, which are managed on a UNIX server. The vendor supplies a program which simply displays the number of licenses currently being used, but it directs the output to /dev/tty (not stdout/stderr/file), and it is a compiled program so it cannot be directly altered using sudo permissions. I can only assume that the vendor is actively trying to prevent their customers from gathering statistics about their concurrent license usage, because the customer might find out they don’t need so many licenses, contract for fewer licenses, and thus the vendor would loose money. 😡 The vendor has to provide some mechanism for determining license usage, but it’s extremely limited. 🙁 I would like to gather statistics every 15 minutes, find the maximum concurrent license usage, so we can contract to the vendor for the ideal number of licenses. 😀 Any help you can provide would be greatly appreciated. Thanks! –Paul.

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Question about UNIX file rights

By mike_bn

Hello experts,

i am a Unix beginner and to test the rules of file rights (rwx)
i created the file

/root/testdir/subdir/test.sh

and set the rights of testdir,subdir, test.sh (using chmod) to various configurations in order to get an idea
in which case you need which rights. Test commands were

– ls (‘Can i read the directory in certain change-mod configurations?’)
– less test.sh (‘What are the requirements in terms of rights to be able to read a file?’)
– test.sh (‘When can i execute a file?’)

My question is, when testing unix access rights, is there a difference
between referencing test.sh by

./tests. and /root/testdir/subdir/test.sh?

I know that for the first command, i need to be in the directory, but in terms of
access rights, are these to ways of referencing the file test.sh totally equivalent? In other words, does
‘less ./test.sh’ always work when ‘less /root/testdir/subdir/test.sh’ and vice versa?
Or is there a configuration for the rights of testdir and/or subdir where one works, and the other not? Same question with executing.

Thands in advance for your help!
Mike

Source: FULL ARTICLE at The UNIX and Linux Forums