10 More Discussions You Might Find Interesting
1. Ubuntu
I'm trying to convert this working bash script into an Ash script,
read -p "Username:" _username
if ! ]]; then
echo "Valid"
else
echo "INVALID"
fi
However, Ash does not recognize the "=~" character.
How can I do this?
Also, is there a good reference guide, so I... (5 Replies)
Discussion started by: fzivkovi
5 Replies
2. Shell Programming and Scripting
Hi.
I have 2 files of below format.
File1
AA~1~STEVE~3.1~4.1~5.1
AA~2~DANIEL~3.2~4.2~5.2
BB~3~STEVE~3.3~4.3~5.3
BB~4~TIM~3.4~4.4~5.4
File 2
AA~STEVE~AA STEVE WORKS at AUTO COMPANY
AA~DANIEL~AA DANIEL IS A ELECTRICIAN
BB~STEVE~BB STEVE IS A COOK
I want to match 1st and 3rd... (2 Replies)
Discussion started by: crypto87
2 Replies
3. Shell Programming and Scripting
Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type... (5 Replies)
Discussion started by: lancesunny
5 Replies
4. Shell Programming and Scripting
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies
5. Shell Programming and Scripting
Hi,
I have field in a file which would come with any special character, how do i check that field?
Eg: @123TYtaasa>>>/ 131dfetr_~2
In the above example, how do I add pattern for any special character on the keyboard.
Thanks (3 Replies)
Discussion started by: techmoris
3 Replies
6. Shell Programming and Scripting
Hi,
I have a file 'imei_01.txt' having the following contents:
$ cat imei_01.txt
a123456
bbr22135
yet223
where I want to check whether the expression 'first single alphabet followed by 6 digits' is present in the file (here it is the first record 'a123456')
I am using the following... (5 Replies)
Discussion started by: royalibrahim
5 Replies
7. UNIX for Dummies Questions & Answers
Alright, I am stuck here.
I have this variable that stores the word = HELLO and I have converted it it to -----
I have asked user to input one character at a time. SAy, if they enter E.
Therefore, I need to search 2nd character and input E there.
makes it -E--- (other checkings have been... (2 Replies)
Discussion started by: felixwhoals
2 Replies
8. Shell Programming and Scripting
Hello Experts,
Can someone help me here:
I have a variable which contains a string with "".
set var1 {a}
set str1 {a is the element i want to match}
Now "regexp $var1 $str1" does not work?
("regexp {a\} $str1" works, but var1 gets it's value automatically from another script)
Is... (6 Replies)
Discussion started by: sumitgarg
6 Replies
9. Shell Programming and Scripting
looking for a bit of help with sed.
I have a file that looks a bit like this:
sdfghhjk
asdfdfghgj
asdfhgghj
werdfvtfh
edftbgh
1211211221
sdffgfm
dfghnhjm
dfvfsgbgh
adsfv bdhgn
1111111dffg
dfv1122
dsgvbghn111111
fffffffgbdghn
fffffff
sfgh3333gs vdf (5 Replies)
Discussion started by: robsonde
5 Replies
10. Shell Programming and Scripting
Hi
] && exit 0
Although it, the $answer, is 'y', the test operation returns true.
&& exit 0
This works but I want to do multiple choice matching.
I don't want to do like:
Please help (2 Replies)
Discussion started by: lalelle
2 Replies