unix

How to convert Utf8 file to CP1252 by Unix

南楼画角 提交于 2020-07-22 12:47:05
问题 I'm trying to transform txt file encoding from UTF8 to ANSI (cp1252). I need this because the file is used in a fixed position Oracle import (external Table) which apparently only supports CP1252. If I import an UTF-8 file, some special characters turn up as two incorrect characters instead. I'm working in a Unix machine (my OS is HP UX). I have been looking for an answer on the web but I don't find any way to do this conversion. For exmple, the POSIX iconv command doesn't have this choose,

shell script relative position from the file

余生长醉 提交于 2020-07-22 06:06:11
问题 I have almost no idea about shell scripts or commands in linux I have a project named projectx projectX happens to be in users/hardik/desktop/projectx I have created a shell script start.sh . This is the content of shell script echo "Starting typescript build in new terminal.." osascript -e 'tell application "Terminal" to do script "npm run build"' sleep 3 echo "Starting firebase functions...." osascript -e 'tell application "Terminal" to do script "firebase emulators:start --only functions"'

Unable to run nohup command from jenkins as a background process

北慕城南 提交于 2020-07-20 08:21:04
问题 UPDATE: Based on below discussion I have edited my answer for more accurate description. I am trying to run a nohup command from jenkins. The full command is nohup java -jar /home/.../jar/server-process-0.35.jar prod >> /var/../server-process-prod.log 2>&1 & This command does not work. I can see status as success in jenkins but no java process in linux. When I do 'ps -ef | grep java' However when I remove the last '&' , that is I change it from run in forground instead of background It starts

Run a .jar file using .sh file in unix

纵然是瞬间 提交于 2020-07-18 05:55:42
问题 I have a jar file DirectoryScanner.jar created in windows 7. I want to execute this jar on a unix server. I ran the following command in putty and the jar run absolutely fine as expected: java -jar DirectoryScanner.jar Now I want to create a .sh file on the unix server which on executing can run this jar. I created a file Report.sh in which I wrote following code to execute this jar: java -cp /home/applvis/Java/UAT/lib/DirectoryScanner.jar com.acc.directory.scanner.SDScanner But when I

Proper way to exit command line program?

懵懂的女人 提交于 2020-07-17 09:34:23
问题 I'm using mac/linux and I know that ctrl-z stops the currently running command in terminal, but I frequently see the process is still running when i check the system monitor. What is the right way to stop a command in terminal? Typically I run into this issue when running python or ruby apps, i'm not sure if that has something to do with it, just thought I would add that. 回答1: Using control-z suspends the process (see the output from stty -a which lists the key stroke under susp ). That

How to make awk produce columns

早过忘川 提交于 2020-07-16 05:49:09
问题 I have a file with two columns. Each line in this file has a different size of words awk '$5=$9' FS="#" OFS="\t" file1** Tomato#Vegetable Orange#Fruit Cucumber#Vegetable Sweat Potato#Fruit This line of code makes it like this: Tomato Vegetable Orange Fruit Cucumber Vegetable Sweat Potato Fruit I am trying to make this file be displayed like this: Tomato Vegetable Orange Fruit Cucumber Vegetable Sweat Potato Fruit What am I doing wrong that does not give me this result? 回答1: With Unix / Linux

Interpreting GDB registers (SSE registers)

戏子无情 提交于 2020-07-15 15:30:04
问题 I've been using GDB for 1 day and I've accumulated a decent understanding of it. However when I set a breakpoint at the final semicolon using GDB and print registers I can't fully interpret the meaning of the data stored into the XMM register. I don't know if the data is in (MSB > LSB) format or vice versa. __m128i S = _mm_load_si128((__m128i*)Array16Bytes); } So this is the result that I'm getting. (gdb) print $xmm0 $1 = { v4_float = {1.2593182e-07, -4.1251766e-18, -5.43431603e-31, -2

Interpreting GDB registers (SSE registers)

微笑、不失礼 提交于 2020-07-15 15:28:07
问题 I've been using GDB for 1 day and I've accumulated a decent understanding of it. However when I set a breakpoint at the final semicolon using GDB and print registers I can't fully interpret the meaning of the data stored into the XMM register. I don't know if the data is in (MSB > LSB) format or vice versa. __m128i S = _mm_load_si128((__m128i*)Array16Bytes); } So this is the result that I'm getting. (gdb) print $xmm0 $1 = { v4_float = {1.2593182e-07, -4.1251766e-18, -5.43431603e-31, -2

remove entirely same duplicate columns in unix

瘦欲@ 提交于 2020-07-10 10:42:45
问题 Let say I have a file as below: number 2 6 7 10 number 6 13 name1 A B C D name1 B E name2 A B C D name2 B E name3 B A D A name3 A F name4 B A D A name4 A F I wish to remove the entirely the same duplicate columns and the output file is as below: number 2 6 7 10 13 name1 A B C D E name2 A B C D E name3 B A D A F name4 B A D A F I use sort and uniq command for lines but never know how to do for columns. Can anyone suggest a good way? 回答1: Here is a way with awk that preserves the order awk 'NR=

UNIX Bash - Removing double quotes from specific strings within a file

淺唱寂寞╮ 提交于 2020-07-09 03:55:07
问题 Apologies if I've formatted this terribly as I've not posted here before. I'm attempting to edit a file to remove double quotation marks that are wrapped around multiple strings of varied lengths. Some of these strings include capitalisation and white-space, normally I would just use a global search and replace, however, some of the strings CAN'T have the double quotes removed as they're required. An extract of the file in question is here: "tplan"."external_plan_ref" "Plan ID", 'CMP' CMP,